I have been working on a project and it works fine on my development machine. When I move it to the stage server for testing I get the following error:
Unable to serialize the session state. In 'StateServer' and 'SQLServer'
The error message goes on to specify one of my business objects as the issue. The code was actually developed by another developer but I believe the issue is when a business object is saved into the session.
Why would that work on my local machine but not on the remote server?
You development machine probably uses the InProc session provider which serializes onto memory. When the SQLServer session provider is used, there are are much stronger requirements on your objects.
Most probably – one of your objects is just not serializable. Reasons could vary, from simple “not marked as serializable” to “relying on external types which are not serializable”.
Try to track down the problematic type by inspecting the inner exception. Usually you’ll find a meaning information there.