Could not load the type error “is not marked as serializable”

There are various issues which may occur on custom application running under SharePoint ,if the application and configuration doesn’t done properly. But one of the issue which I thought really pained was Could not load the type and the specific type “”is not marked as serializable“.

Basically the reasons to serialize is to persist the state of an object to a storage medium so an exact copy can be recreated at a later stage, and to send the object by value from one application domain to another.It is also used by remoting to pass objects by value from one application domain to another.
 
But the chief disadvantage is the overhead involved in serializing and de-serializing data, as well as latency issues with transmitting text over a TCP network.

So I don’t want to mark the class as “Serializable” and started to do the investigation and ended up with a simple solution by setting the <sessionState mode=”InProc” /> instead it was earlier “SQLServer”  in my QA environment and the application started work perfectly.

But still I am just having concerns about using “InProc”  because I think my environment is a WebGarden and I don’t think so storing the session state in memory will not help any change to web.config or application pool restart will vanish my session objects.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s