Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Session serialization error when sessionState mode is not "InProc"

Reply
Thread Tools

Session serialization error when sessionState mode is not "InProc"

 
 
feliz
Guest
Posts: n/a
 
      08-29-2008
- Create a new webservice project with a webmethod that has enabled sessions
(WebMethod(EnableSession=true) attribute).
- Set the sessionState mode to any mode other than "InProc".
- Run the project (either in IIS or the Development server)
- Call the webmethod

The request will fail with the following exception:

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.


Stack Trace:

[SerializationException: Type 'System.Resources.RuntimeResourceSet' in
Assembly 'mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' is not marked as serializable.]

System.Runtime.Serialization.FormatterServices.Int ernalGetSerializableMembers(RuntimeType type) +2700482

System.Runtime.Serialization.FormatterServices.Get SerializableMembers(Type
type, StreamingContext context) +245

System.Runtime.Serialization.Formatters.Binary.Wri teObjectInfo.InitMemberInfo() +88

System.Runtime.Serialization.Formatters.Binary.Wri teObjectInfo.InitSerialize(Object
obj, ISurrogateSelector surrogateSelector, StreamingContext context,
SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter,
ObjectWriter objectWriter) +175

System.Runtime.Serialization.Formatters.Binary.Wri teObjectInfo.Serialize(Object
obj, ISurrogateSelector surrogateSelector, StreamingContext context,
SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter,
ObjectWriter objectWriter) +50

System.Runtime.Serialization.Formatters.Binary.Obj ectWriter.Serialize(Object
graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck) +438

System.Runtime.Serialization.Formatters.Binary.Bin aryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck) +131
System.Web.Util.AltSerialization.WriteValueToStrea m(Object value,
BinaryWriter writer) +1513

[HttpException (0x80004005): 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.]
System.Web.Util.AltSerialization.WriteValueToStrea m(Object value,
BinaryWriter writer) +1602

System.Web.SessionState.SessionStateItemCollection .WriteValueToStreamWithAssert(Object value, BinaryWriter writer) +34
System.Web.SessionState.SessionStateItemCollection .Serialize(BinaryWriter
writer) +627

StateMirror.Client.SessionState.SessionStateUtilit y.Serialize(SessionStateStoreData item, Stream stream) +338

StateMirror.Client.SessionState.SessionStateItemWr apper2.SerializeData(Stream
stream, Boolean compress) +397
StateMirror.Client.CommonStoreAPI.SetItemInternal( String id,
CommonItemWrapperBase itemWrapper, Boolean inStorage, Boolean sendIsHave,
Msg& checkReq, Msg& setReq) +1814
StateMirror.Client.SessionStateStoreAPI.SetItem(St ring id,
CommonItemWrapperBase itemWrapper, Boolean inStorage) +168

StateMirror.Client.SessionState.SessionStateStoreP rovider.SetAndReleaseItemExclusive(HttpContext
context, String id, SessionStateStoreData item, Object lockId, Boolean
newItem) +224

StateMirror.Client.SessionState.SessionStateStoreP rovider.SaveAppState(HttpContext context) +435

StateMirror.Client.SessionState.SessionStateStoreP rovider.EndRequest(HttpContext context) +50
System.Web.SessionState.SessionStateModule.OnEndRe quest(Object source,
EventArgs eventArgs) +214

System.Web.SyncEventExecutionStep.System.Web.HttpA pplication.IExecutionStep.Execute() +92
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously) +64


I am using version 2 of the .NET framework and developing in Visual Studio
2008.

Thank you
 
Reply With Quote
 
 
 
 
John Saunders
Guest
Posts: n/a
 
      08-31-2008
I can't reproduce this by using the Hello, World server created by using
File->Add New Project->ASP.NET Web Service Project, then setting
EnableSession=true and session mode="StateServer".

This looks like a problem with your StateMirror software
(www.statemirror.com).

--
John Saunders | MVP - Connected System Developer

"feliz" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> - Create a new webservice project with a webmethod that has enabled
> sessions
> (WebMethod(EnableSession=true) attribute).
> - Set the sessionState mode to any mode other than "InProc".
> - Run the project (either in IIS or the Development server)
> - Call the webmethod
>
> The request will fail with the following exception:
>
> 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.
>
>
> Stack Trace:
>
> [SerializationException: Type 'System.Resources.RuntimeResourceSet' in
> Assembly 'mscorlib, Version=2.0.0.0, Culture=neutral,
> PublicKeyToken=b77a5c561934e089' is not marked as serializable.]
>
> System.Runtime.Serialization.FormatterServices.Int ernalGetSerializableMembers(RuntimeType
> type) +2700482
>
> System.Runtime.Serialization.FormatterServices.Get SerializableMembers(Type
> type, StreamingContext context) +245
>
> System.Runtime.Serialization.Formatters.Binary.Wri teObjectInfo.InitMemberInfo()
> +88
>
> System.Runtime.Serialization.Formatters.Binary.Wri teObjectInfo.InitSerialize(Object
> obj, ISurrogateSelector surrogateSelector, StreamingContext context,
> SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter,
> ObjectWriter objectWriter) +175
>
> System.Runtime.Serialization.Formatters.Binary.Wri teObjectInfo.Serialize(Object
> obj, ISurrogateSelector surrogateSelector, StreamingContext context,
> SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter,
> ObjectWriter objectWriter) +50
>
> System.Runtime.Serialization.Formatters.Binary.Obj ectWriter.Serialize(Object
> graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck) +438
>
> System.Runtime.Serialization.Formatters.Binary.Bin aryFormatter.Serialize(Stream
> serializationStream, Object graph, Header[] headers, Boolean fCheck) +131
> System.Web.Util.AltSerialization.WriteValueToStrea m(Object value,
> BinaryWriter writer) +1513
>
> [HttpException (0x80004005): 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.]
> System.Web.Util.AltSerialization.WriteValueToStrea m(Object value,
> BinaryWriter writer) +1602
>
> System.Web.SessionState.SessionStateItemCollection .WriteValueToStreamWithAssert(Object
> value, BinaryWriter writer) +34
>
> System.Web.SessionState.SessionStateItemCollection .Serialize(BinaryWriter
> writer) +627
>
> StateMirror.Client.SessionState.SessionStateUtilit y.Serialize(SessionStateStoreData
> item, Stream stream) +338
>
> StateMirror.Client.SessionState.SessionStateItemWr apper2.SerializeData(Stream
> stream, Boolean compress) +397
> StateMirror.Client.CommonStoreAPI.SetItemInternal( String id,
> CommonItemWrapperBase itemWrapper, Boolean inStorage, Boolean sendIsHave,
> Msg& checkReq, Msg& setReq) +1814
> StateMirror.Client.SessionStateStoreAPI.SetItem(St ring id,
> CommonItemWrapperBase itemWrapper, Boolean inStorage) +168
>
> StateMirror.Client.SessionState.SessionStateStoreP rovider.SetAndReleaseItemExclusive(HttpContext
> context, String id, SessionStateStoreData item, Object lockId, Boolean
> newItem) +224
>
> StateMirror.Client.SessionState.SessionStateStoreP rovider.SaveAppState(HttpContext
> context) +435
>
> StateMirror.Client.SessionState.SessionStateStoreP rovider.EndRequest(HttpContext
> context) +50
> System.Web.SessionState.SessionStateModule.OnEndRe quest(Object source,
> EventArgs eventArgs) +214
>
> System.Web.SyncEventExecutionStep.System.Web.HttpA pplication.IExecutionStep.Execute()
> +92
> System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
> completedSynchronously) +64
>
>
> I am using version 2 of the .NET framework and developing in Visual Studio
> 2008.
>
> Thank you


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
session expiry when using sessionState mode="SQLServer" Moe Sisko ASP .Net 3 04-29-2008 12:42 AM
SessionState Mode=SQLServer and Session.Abandon =?Utf-8?B?RWQ=?= ASP .Net 1 09-20-2006 08:02 PM
Session contents lost despite Session.Timeout = 3000; and <sessionState mode="InProc" cookieless="false" timeout="300"> Carpe Diem ASP .Net 3 02-23-2004 07:10 PM
SessionState "StateServer" serialization ... Ashish ASP .Net 2 01-30-2004 04:41 AM
Session Expired (sessionState mode="SQLServer") TSelvan ASP .Net 1 07-30-2003 05:13 AM



Advertisments