all groups > dotnet remoting > june 2004 >
You're in the

dotnet remoting

group:

Serialization Question


Serialization Question Sahil Malik
6/7/2004 5:29:29 PM
dotnet remoting:
I have ISerializable implementation that looks as follows -
public void GetObjectData(SerializationInfo info, StreamingContext context)

{

info.AddValue("description",description) ;

info.AddValue("UsageData_InnerList", InnerList, typeof(Hashtable)) ;

}

public UsageDatas(SerializationInfo info, StreamingContext context)

{

InnerList = (Hashtable)
info.GetValue("UsageData_InnerList",typeof(Hashtable)) ;

description = info.GetString("description") ;

}



The problem is that when I Serialize, the HashTable (InnerList), has 200
rows, but when I deserialize, it has ZERO. What am I doing wrong??


- Sahil Malik
Independent Consultant
You can reach me thru my blog - http://dotnetjunkies.com/WebLog/sahilmalik/




Re: Serialization Question Sahil Malik
6/7/2004 5:32:37 PM
Additional info that might help, I persisted using SoapFormatter to a file,
and the data did get serialized properly .. it's the deserialization which
is causing to be a pain.

--
- Sahil Malik
Independent Consultant
You can reach me thru my blog - http://dotnetjunkies.com/WebLog/sahilmalik/



[quoted text, click to view]

Re: Serialization Question Sahil Malik
6/8/2004 12:34:59 AM
Never mind .. I fixed it .. seriously, I'm a super duper serialization guru
now .. oh man, I wish these things were easier to fix.

The error was -

Instead of,
_state = info.GetInt16("_state") ;

I had typed,
info.GetInt16("_state") ;

And that was messing up EVERYTHING.

Took me half a day to figure this out, I wish Serialization errors were
easier to figure out.

- Sahil Malik
Independent Consultant
You can reach me thru my blog - http://dotnetjunkies.com/WebLog/sahilmalik/



[quoted text, click to view]

Re: Serialization Question Fritz
6/11/2004 10:37:53 PM
[quoted text, click to view]
I thought you had answered a previous post (Re: CollectionBase and custom
deserialization) that it is not possible to store into the InnerList
property of the collection. Is your class not a CollectionBase, but just
AddThis Social Bookmark Button