I'm getting the following error in my application:
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.
The stack trace isn't providing any good information on which object is not able to serialize. Is there a good way to find the problem child?
Edit: I've found the issue, I was trying to serialize a Linq statement(not executed). But I'll try an choose an answer that would have best solved this issue.