Serialization Error

Discussion in 'ASP .Net Web Services' started by Maximus, Jan 19, 2004.

  1. Maximus

    Maximus Guest

    Hi Everyone,

    I was using Inprocess session objects, but incase of aspnet process
    crashes the session objects were lost as a result I decided to shift to
    out of porocess session objects. For this i had to serialize the
    objects. While doing that I made the classes serializable whose objects
    I store in sessions. However, when I run the application I get the
    following error.






    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'.
    Description: An unhandled exception occurred during the execution of the
    current web request. Please review the stack trace for more information
    about the error and where it originated in the code.

    Exception Details: System.Web.HttpException: 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'.

    Source Error:

    An unhandled exception was generated during the execution of the current
    web request. Information regarding the origin and location of the
    exception can be identified using the exception stack trace below.

    Stack Trace:


    [SerializationException: The type ASP.default_aspx in Assembly h5ahqjmx,
    Version=0.0.0.0, Culture=neutral, PublicKeyToken=null is not marked as
    serializable.]

    System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(RuntimeType
    type, Boolean excludeNonSerializable) +853

    System.Runtime.Serialization.FormatterServices.GetSerializableMembers(Type
    type, StreamingContext context) +300

    System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInfo()
    +103

    System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object
    obj, ISurrogateSelector surrogateSelector, StreamingContext context,
    SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter) +493

    System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object
    obj, ISurrogateSelector surrogateSelector, StreamingContext context,
    SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter) +48

    System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Write(WriteObjectInfo
    objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo) +515

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

    System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream
    serializationStream, Object graph, Header[] headers, Boolean fCheck) +136

    System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream
    serializationStream, Object graph) +13
    System.Web.Util.AltSerialization.WriteValueToStream(Object value,
    BinaryWriter writer)

    [HttpException (0x80004005): 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'.]
    System.Web.Util.AltSerialization.WriteValueToStream(Object value,
    BinaryWriter writer)
    System.Web.SessionState.SessionDictionary.Serialize(BinaryWriter writer)

    System.Web.SessionState.StateClientManager.Serialize(SessionStateItem
    item, Stream stream)

    System.Web.SessionState.OutOfProcStateClientManager.System.Web.SessionState.IStateClientManager.Set(String
    id, SessionStateItem item, Boolean inStorage)
    System.Web.SessionState.SessionStateModule.OnReleaseState(Object
    source, EventArgs eventArgs)

    System.Web.SyncEventExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
    +60
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
    completedSynchronously) +87




    I'll appreciate if anybody could help me with this.

    Thanks.
     
    Maximus, Jan 19, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Maximus

    Serialization Error

    Maximus, Jan 19, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    4,989
    Gaurav Khanna [C# MVP]
    Jan 28, 2004
  2. Replies:
    8
    Views:
    2,253
    deadsea
    Jan 2, 2005
  3. Replies:
    3
    Views:
    1,035
  4. Dimitri Ognibene
    Replies:
    4
    Views:
    785
    Dimitri Ognibene
    Sep 2, 2006
  5. Ramunas Urbonas
    Replies:
    1
    Views:
    403
    Dino Chiesa [Microsoft]
    Jul 27, 2004
Loading...

Share This Page