Using StateServer mode for Session State throws error

Shannon Dunn asked on July 6, 2015 10:05

I tried tonight to update our site to use StateServer for session state management instead of InProc. As soon as I made the change I got this error whenever I visit the front of my site (but weirdly not the admin page):

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.

Why cant I switch to using the StateServer? I have it enabled in services and set to Automatic. Its started as well.

Recent Answers


Bill Tran answered on August 14, 2015 19:04

It appears you have some objects (classes) which you are storing in the Session State. You will need to explicitly add the [Serializable()] attribute to the class declaration.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.