title: Unable to serialize the session state, which is related to System.Data.Linq. EntitySet
body: <p>Recently I am playing with the Windows Server 2008,
  and would like to make some configuration for my web application.
  I have changed the Session State for my application to "State Server" so it can make use of more work process (Now it is set to 4).</p>
  
  <p>Afterwards I have got this error when I attempt to login to the application.</p>
  
  <p><strong>Unable to serialize the session state</strong>. 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>
  
  <p>I suspect it is related to the EntitySet I have declared because I see this in the Stack Trace when the error occur:</p>
  
  <blockquote>
    <p>[SerializationException: Type
    'System.Data.Linq.EntityRef`1[[CtcSystem.Domain.Entities.Account.Account,
    CtcSystem.Domain, Version=1.0.0.0, Culture=neutral,
    PublicKeyToken=null]]' in Assembly 'System.Data.Linq, Version=4.0.0.0,
    Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as
    serializable.]</p>
  </blockquote>
  
  <p>I have used <strong>[Serializable]</strong> tag on my classes,
  so is there any way I have to do to make the EntitySet serializable so that the application can run under State Server?</p>
  
  <p>Thanks</p>