Unable to serialize the session state

G

Guest

Hi,

I am getting the following error intermittently:

"Unable to serialize the session state. Please note that non-serializable
objects or MarshalByRef objects are not permitted when Session state mode is
'StateServer' or 'SqlServer' "

I have had this when trying to attach to a running process in debug when the
components have not been jitted, but this error appeared in the release mode
in the live application. The objects used have worked time and time again,
and then it suddenly falls over with this error, then starts working again.

Does anyone know what might be causing this?
 
M

Michael Nemtsev [MVP]

Hello cashdeskmac,

Dont quite understand when in happens in release application
could you provide additional info?

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


c> Hi,
c>
c> I am getting the following error intermittently:
c>
c> "Unable to serialize the session state. Please note that
c> non-serializable objects or MarshalByRef objects are not permitted
c> when Session state mode is 'StateServer' or 'SqlServer' "
c>
c> I have had this when trying to attach to a running process in debug
c> when the components have not been jitted, but this error appeared in
c> the release mode in the live application. The objects used have
c> worked time and time again, and then it suddenly falls over with this
c> error, then starts working again.
c>
c> Does anyone know what might be causing this?
c>
 
D

Dave Bush

Normally this is because you are running using a session server or sql
session server instead of inproc. But, you'd get the error consistently
if that was the case. Maybe it's an object to only gets stored to the
session occasionally?

I've run into situations where I didn't get the error until the end of the
page generation. So it may be hard to track down exactly which object you
are putting into the session that needs to be marked as serializable.
You'll need to mark the class serializable once you find it.

-----Original Message-----
From: cashdeskmac [mailto:[email protected]]
Posted At: Tuesday, November 06, 2007 5:47 AM
Posted To: microsoft.public.dotnet.framework.aspnet
Conversation: Unable to serialize the session state
Subject: Unable to serialize the session state

Hi,

I am getting the following error intermittently:

"Unable to serialize the session state. Please note that non-serializable
objects or MarshalByRef objects are not permitted when Session state mode
is
'StateServer' or 'SqlServer' "

I have had this when trying to attach to a running process in debug when
the
components have not been jitted, but this error appeared in the release
mode
in the live application. The objects used have worked time and time
again,
and then it suddenly falls over with this error, then starts working
again.

Does anyone know what might be causing this?
 
G

Guest

As I mentioned in my original post, this error often appears when trying to
debug a component which has not been jitted, and I thought it might be
masking another error this time, too.

This turned out to be the case. The actual error was that the object
contained a string which was 100 characters long but when trying to insert it
into the database it fell over because the field size was set to varchar(75).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top