我正在使用 asp.net 并将会话配置为存储在 SQL 服务器中。我的项目有很多对象和几个 linq-to-sql dbml。我已将它们全部配置为具有单向序列化,并进行了一些自定义更改。
当我运行应用程序时,我的 application_error 事件处理程序中不断收到此错误
在程序集“App_Code.thzd8p2j, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null”中键入“Data.Karaoke.spCWP_SelUserPrivilegesResult”未标记为可序列化。
从错误我不确定它是否来自 dbml.designer.cs 文件,这是代码:
[Function(Name="dbo.spCWP_SelUserPrivileges")]
public ISingleResult<spCWP_SelUserPrivilegesResult> spCWP_SelUserPrivileges([Parameter(Name="IDCWPUser", DbType="Int")] System.Nullable<int> iDCWPUser)
{
IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), iDCWPUser);
return ((ISingleResult<spCWP_SelUserPrivilegesResult>)(result.ReturnValue));
}
和
[DataContract()]
public partial class spCWP_SelUserPrivilegesResult
{
private int _IDTypeCWPModule;
private string _TypeKey;
private bool _Security;
public spCWP_SelUserPrivilegesResult()
{
}
[Column(Storage="_IDTypeCWPModule", DbType="Int NOT NULL")]
[DataMember(Order=1)]
public int IDTypeCWPModule
{
get
{
return this._IDTypeCWPModule;
}
set
{
if ((this._IDTypeCWPModule != value))
{
this._IDTypeCWPModule = value;
}
}
}
[Column(Storage="_TypeKey", DbType="VarChar(10) NOT NULL", CanBeNull=false)]
[DataMember(Order=2)]
public string TypeKey
{
get
{
return this._TypeKey;
}
set
{
if ((this._TypeKey != value))
{
this._TypeKey = value;
}
}
}
[Column(Storage="_Security", DbType="Bit NOT NULL")]
[DataMember(Order=3)]
public bool Security
{
get
{
return this._Security;
}
set
{
if ((this._Security != value))
{
this._Security = value;
}
}
}
}
如何确定错误的来源?或者错误是什么意思?
我不确定如何解决或寻找什么来解决问题。