-
-
fdnz.mat
-
3 posts
|
I'm trying to store a Lightspeed entity in the database to avoid round trips when moving between pages in a cross-page postback. Unfortunately, I'm getting the error described in http://www.mindscapehq.com/forums/thread/1419
System.Web.HttpException: 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.InvalidOperationException:
Mindscape.LightSpeed.Validation.ValidationError cannot be serialized
because it does not have a parameterless constructor.
The linked thread claims this issue was fixed, but apparently not. I'm using version 4.0.1173.19866 with my project. Here's the original stack trace:
[InvalidOperationException: Mindscape.LightSpeed.Validation.ValidationError cannot be serialized because it does not have a parameterless constructor.]
System.Xml.Serialization.TypeDesc.CheckSupported() +3937083
System.Xml.Serialization.TypeDesc.CheckSupported() +3937204
System.Xml.Serialization.TypeScope.GetTypeDesc(Type type, MemberInfo source, Boolean directReference, Boolean throwOnError) +170
System.Xml.Serialization.ModelScope.GetTypeModel(Type type, Boolean directReference) +83
System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(Type type, XmlRootAttribute root, String defaultNamespace) +58
System.Xml.Serialization.XmlSerializerFactory.CreateSerializer(Type type, XmlAttributeOverrides overrides, Type[] extraTypes, XmlRootAttribute root, String defaultNamespace, String location, Evidence evidence) +170
System.Xml.Serialization.XmlSerializerFactory.CreateSerializer(Type type, XmlRootAttribute root) +40
System.Data.Common.ObjectStorage.GetXmlSerializer(Type type, XmlRootAttribute attribute) +555
System.Data.Common.ObjectStorage.ConvertObjectToXml(Object value, XmlWriter xmlWriter, XmlRootAttribute xmlAttrib) +56
System.Data.XmlDataTreeWriter.XmlDataRowWriter(DataRow row, String encodedTableName) +2682
System.Data.XmlDataTreeWriter.SaveDiffgramData(XmlWriter xw, Hashtable rowsOrder) +551
System.Data.NewDiffgramGen.Save(XmlWriter xmlw, DataTable table) +175
System.Data.DataSet.GetRemotingDiffGram(DataTable table) +135
System.Data.DataTable.SerializeDataTable(SerializationInfo info, StreamingContext context, Boolean isSingleTable, SerializationFormat remotingFormat) +364
System.Data.DataTable.GetObjectData(SerializationInfo info, StreamingContext context) +94
System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter) +7631706
System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter) +51
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck) +410
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck) +134
System.Web.Util.AltSerialization.WriteValueToStream(Object value, BinaryWriter writer) +1577
[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) +1662
System.Web.SessionState.SessionStateItemCollection.WriteValueToStreamWithAssert(Object value, BinaryWriter writer) +34
System.Web.SessionState.SessionStateItemCollection.Serialize(BinaryWriter writer) +606
System.Web.SessionState.SessionStateUtility.Serialize(SessionStateStoreData item, Stream stream) +239
System.Web.SessionState.SessionStateUtility.SerializeStoreData(SessionStateStoreData item, Int32 initialStreamSize, Byte[]& buf, Int32& length) +72
System.Web.SessionState.SqlSessionStateStore.SetAndReleaseItemExclusive(HttpContext context, String id, SessionStateStoreData item, Object lockId, Boolean newItem) +116
System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs) +560
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
|