Unable to serialize the session state???


https://forum.kartris.com/Topic3618.aspx
Print Topic | Close Window

By t_rick_s - Sat 14 Feb 2015
What in the world does this mean? All I get from clicking the checkout button is a mess of images and text in the upper right corner with the "Oops"-page as background.
Any clues?

Kartris v2.8001 on shared hosting.

>> Unhandled Error occurred in Page:http://www.qwerty.xx/Checkout.aspx
-----------------------------------------------------------------------------
>> 2015-02-14 23:10:33
>> Version:2,8001
>> URL:http://www.qwerty.xx/Checkout.aspx
>> 85.225.82.137
>> DESCRIPTION:
System.Web.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.Runtime.Serialization.SerializationException: Type 'Kartris.Interfaces.objShippingDetails+BaseAddressClass' in Assembly 'Kartris.Shipping, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.
at System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(RuntimeType type)
at System.Runtime.Serialization.FormatterServices.GetSerializableMembers(Type type, StreamingContext context)
at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInfo()
at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder)
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Write(WriteObjectInfo objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo)
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck)
at System.Web.Util.AltSerialization.WriteValueToStream(Object value, BinaryWriter writer)
at System.Web.Util.AltSerialization.WriteValueToStream(Object value, BinaryWriter writer)
at System.Web.SessionState.SessionStateItemCollection.WriteValueToStreamWithAssert(Object value, BinaryWriter writer)
at System.Web.SessionState.SessionStateItemCollection.Serialize(BinaryWriter writer)
at System.Web.SessionState.SessionStateUtility.Serialize(SessionStateStoreData item, Stream stream)
at System.Web.SessionState.SessionStateUtility.SerializeStoreData(SessionStateStoreData item, Int32 initialStreamSize, Byte[]& buf, Int32& length, Boolean compressionEnabled)
at System.Web.SessionState.OutOfProcSessionStateStore.SetAndReleaseItemExclusive(HttpContext context, String id, SessionStateStoreData item, Object lockId, Boolean newItem)
at System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

==================================================
By Mart - Sat 14 Feb 2015
Is this on plain vanilla server or development machine - or something a bit trickier, like a load balanced platform at an ISP?
By t_rick_s - Sun 15 Feb 2015
The last of the three i'm afraid.

Edit:
A pic on the mess at Checkout.sapx Smile
http://forum.kartris.com/Uploads/Images/1b1ed050-c029-4f97-80ae-43b0.PNG

Also, if it helps for someone to give me an idea on where to start error checking, I'm using PO_OfflinePayment in FAKE-mode as my only option.
By t_rick_s - Tue 17 Feb 2015
Could it be that the server host runs ASP.NET 4.0 and not 4.5?
Is the serialization specific to 4.5?
Everything else seems to work regarding input and output to the server host.
I can register new users, add to basket, get confirmation mails and send various posts.

I will start to check my front end skin code against the original Kartris skin. Thats the only thing I can think about right now to be an cause of error.
By Paul - Thu 19 Feb 2015
It mentions that it is using the session state service in SQL mode. I do recall there are several ways to set how the session is maintained in Windows. The default is normally in memory. However, SQL server is an alternative. I assume that in the case of SQL server, it is fine storing numbers and strings held in sessions, but not more complex objects and arrays. These need to be serialized, which basically means converted to text/XML for storage. I assume some of the items stored in the session cannot be serialized. If your host cannot change the method of storing sessions, this might not be easily fixable. It's not something I've seen reported before, so I assume that storing sessions on SQL server is not a common practice even on shared hosting.