Monday, 7 June 2010

Using Session State in SharePoint 2010

Problem: I have setup session state but when I try add a custom object (class instance) to me ASP.NET session state (SQL) I get an error "unable to serialize the session state. in 'stateserver' and 'sqlserver' mode will serialize".
Initial Hypothesis:
I am adding a class to my session state
Client Instance = new Client("Paul", "Male");
HttpContext.Current.Session["ASPNETSession"] = Instance;
The Client class is not marked as Serializable

Mark the "Client" class as [Serializable]


Post a Comment