title: How can I find which object in ASP.NET can't be serialized?
body: <p>I'm getting the following error in my application:</p>
  
  <blockquote>
    <p>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.</p>
  </blockquote>
  
  <p>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?</p>
  
  <p>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.</p>