ResolutionsNET
IS-IT--Management
I wonder if anyone can help me.
I have used xsd to generate a c# class from an xml file.
This class is currently being used in my application and works perfectly ok when stored in InProc session.
But when moving to StateServer, it throws the "Unable to serialize the session state", now I know the reasons why it throws this error. But I have a very simple xml structure (and in turn a simply generated class).
Can anyone help me.
The XML structure is simple, i.e.
<AAAs>
<AAA Name="x" Type="y">
<BBB x="1" />
<CCC x="1" y="2"/>
<CCC x="2" y="3"/>
</AAA>
<AAA Name="x" Type="y">
<BBB x="1" />
<CCC x="1" y="2"/>
<CCC x="2" y="3"/>
</AAA>
</AAAs>
And I am loading it like this;
MmlSerializer serializer = new XmlSerializer(typeof(AAAs));
// Read in the XML document
FileStream fs = new FileStream( filepath )
// Declare an object variable of the type to be deserialized.
AAAs newobject
// Use the Deserialize method to restore the object's state with data from the XML document.
newobject = (AAAs)serializer.Deserialize(fs);
Session["AAAs"] = newobject;
Can anyone help, I'd really like to get this working with StateServer rather than InProc.
Thanks
I have used xsd to generate a c# class from an xml file.
This class is currently being used in my application and works perfectly ok when stored in InProc session.
But when moving to StateServer, it throws the "Unable to serialize the session state", now I know the reasons why it throws this error. But I have a very simple xml structure (and in turn a simply generated class).
Can anyone help me.
The XML structure is simple, i.e.
<AAAs>
<AAA Name="x" Type="y">
<BBB x="1" />
<CCC x="1" y="2"/>
<CCC x="2" y="3"/>
</AAA>
<AAA Name="x" Type="y">
<BBB x="1" />
<CCC x="1" y="2"/>
<CCC x="2" y="3"/>
</AAA>
</AAAs>
And I am loading it like this;
MmlSerializer serializer = new XmlSerializer(typeof(AAAs));
// Read in the XML document
FileStream fs = new FileStream( filepath )
// Declare an object variable of the type to be deserialized.
AAAs newobject
// Use the Deserialize method to restore the object's state with data from the XML document.
newobject = (AAAs)serializer.Deserialize(fs);
Session["AAAs"] = newobject;
Can anyone help, I'd really like to get this working with StateServer rather than InProc.
Thanks