“无法序列化会话状态”错误
我在网上看到说是添加[Serializable],不过还是不行啊高手给支个招呢。。。
下面是全部的出错信息
“/”应用程序中的服务器错误。
--------------------------------------------------------------------------------
无法序列化会话状态。在“StateServer”或“SQLServer”模式下, 将序列化会话状态对象,因此不允许使用无法序列化的对象或 MarshalByRef 对象。如果自定义会话状态存储在“Custom”模式下执行了类似的序列化,则适用同样的限制。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.Web.HttpException: 无法序列化会话状态。在“StateServer”或“SQLServer”模式下, 将序列化会话状态对象,因此不允许使用无法序列化的对象或 MarshalByRef 对象。如果自定义会话状态存储在“Custom”模式下执行了类似的序列化,则适用同样的限制。
源错误:
执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。
堆栈跟踪:
[SerializationException: 程序集“App_Code.fmvconly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null”中的类型“System.Web.Administration.WebAdminRemotingManager”未标记为可序列化。]
System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(RuntimeType type) +2317173
System.Runtime.Serialization.FormatterServices.GetSerializableMembers(Type type, StreamingContext context) +245
System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInfo() +88
System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter) +305
System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter) +50
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck) +438
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck) +131
System.Web.Util.AltSerialization.WriteValueToStream(Object value, BinaryWriter writer) +1511
[HttpException (0x80004005): 无法序列化会话状态。在“StateServer”或“SQLServer”模式下, 将序列化会话状态对象,因此不允许使用无法序列化的对象或 MarshalByRef 对象。如果自定义会话状态存储在“Custom”模式下执行了类似的序列化,则适用同样的限制。]
System.Web.Util.AltSerialization.WriteValueToStream(Object value, BinaryWriter writer) +1601
System.Web.SessionState.SessionStateItemCollection.WriteValueToStreamWithAssert(Object value, BinaryWriter writer) +35
System.Web.SessionState.SessionStateItemCollection.Serialize(BinaryWriter writer) +626
System.Web.SessionState.SessionStateUtility.Serialize(SessionStateStoreData item, Stream stream) +259
System.Web.SessionState.SessionStateUtility.SerializeStoreData(SessionStateStoreData item, Int32 initialStreamSize, Byte[]& buf, Int32& length) +61
System.Web.SessionState.OutOfProcSessionStateStore.SetAndReleaseItemExclusive(HttpContext context, String id, SessionStateStoreData item, Object lockId, Boolean newItem) +88
System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs) +612
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +138
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +65
--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:2.0.50727.42; 版本:2.0.50727.42