LLBLGen Pro 2.0
ASP.NET C# 2.0
Adapter Model
DB: SQL Server 2005
Issue:
We just changed our session state to use SQLServer and now we are having Serialization issues on several entity (moving the app to a farm). As noted from other threads - we do not have any inherited entities.
When we use session state inproc the application works.
Error received:
Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode, ASP.NET will serialize the session state objects, and as a result non-serializable objects or MarshalByRef objects are not permitted. The same restriction applies if similar serialization is done by the custom session state store in 'Custom' mode.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SerializationException: Cannot add the same member twice to a SerializationInfo object.]
System.Runtime.Serialization.SerializationInfo.AddValue(String name, Object value, Type type) +2672614
System.Runtime.Serialization.SerializationInfo.AddValue(String name, Object value) +57
SD.LLBLGen.Pro.ORMSupportClasses.EntityBase2.GetObjectData(SerializationInfo info, StreamingContext context) +224
STEI.Cafe.Data.LLBL.EntityClasses.CafeEmbalmEntity.GetObjectData(SerializationInfo info, StreamingContext context) +150
System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter) +281
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.Write(WriteObjectInfo objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo) +411
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck) +489
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) +1549
[HttpException (0x80004005): Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode, ASP.NET will serialize the session state objects, and as a result non-serializable objects or MarshalByRef objects are not permitted. The same restriction applies if similar serialization is done by the custom session state store in 'Custom' mode.]
System.Web.Util.AltSerialization.WriteValueToStream(Object value, BinaryWriter writer) +1638
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.SqlSessionStateStore.SetAndReleaseItemExclusive(HttpContext context, String id, SessionStateStoreData item, Object lockId, Boolean newItem) +115
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