This is a migrated thread and some comments may be shown as answers.

SerializationException when using SQL Server for sessionState

3 Answers 203 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jorge
Top achievements
Rank 1
Jorge asked on 02 Aug 2010, 03:37 PM
I get the following exception when sessionState = SQL mode

[SerializationException: Type
'Telerik.Reporting.ObjectDataSource' in Assembly 'Telerik.Reporting, Version=4.0.10.310, Culture=neutral, PublicKeyToken=a9d7983dfcc261be' is not marked as serializable.]
   System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(RuntimeType type) +9452985
   System.Runtime.Serialization.FormatterServices.GetSerializableMembers(Type type, StreamingContext context) +247
   System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInfo() +160
   System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder) +218
   System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Write(WriteObjectInfo objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo) +388
   System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteMembers(NameInfo memberNameInfo, NameInfo memberTypeNameInfo, Object memberData, WriteObjectInfo objectInfo, NameInfo typeNameInfo, WriteObjectInfo memberObjectInfo) +481
   System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteMemberSetup(WriteObjectInfo objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo, String memberName, Type memberType, Object memberData, WriteObjectInfo memberObjectInfo) +139
   System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Write(WriteObjectInfo objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo, String[] memberNames, Type[] memberTypes, Object[] memberData, WriteObjectInfo[] memberObjectInfos) +186
   System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Write(WriteObjectInfo objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo) +480
   System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck) +444
   System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck) +133
   System.Web.Util.AltSerialization.WriteValueToStream(Object value, BinaryWriter writer) +1708
 
[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) +1793
   System.Web.SessionState.SessionStateItemCollection.WriteValueToStreamWithAssert(Object value, BinaryWriter writer) +34
   System.Web.SessionState.SessionStateItemCollection.Serialize(BinaryWriter writer) +638
   System.Web.SessionState.SessionStateUtility.Serialize(SessionStateStoreData item, Stream stream) +244
   System.Web.SessionState.SessionStateUtility.SerializeStoreData(SessionStateStoreData item, Int32 initialStreamSize, Byte[]& buf, Int32& length, Boolean compressionEnabled) +67
   System.Web.SessionState.SqlSessionStateStore.SetAndReleaseItemExclusive(HttpContext context, String id, SessionStateStoreData item, Object lockId, Boolean newItem) +140
   System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs) +807
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

3 Answers, 1 is accepted

Sort by
0
Alexander
Top achievements
Rank 1
answered on 04 Oct 2010, 02:15 PM
same error with class Telerik.Reporting.Service.NameValueDictionary. Version 4.1.10.921
0
FISCAL
Top achievements
Rank 1
answered on 19 Oct 2010, 10:30 AM
Hi Jorge,

As stated in the error message, please attribute your persistence class with [Serialize]. E.g.

[Serialize]
Class Test
{
....
}

It should resolve the problem.

Many thanks.
MG
0
Mj
Top achievements
Rank 1
answered on 14 May 2012, 10:26 AM
same with the issue above., i have a problem in gridcolumnsettings. i already serialize my models., yet nothings happened.
Tags
General Discussions
Asked by
Jorge
Top achievements
Rank 1
Answers by
Alexander
Top achievements
Rank 1
FISCAL
Top achievements
Rank 1
Mj
Top achievements
Rank 1
Share this question
or