views:

265

answers:

1

I have the same issue as in this post:

http://social.microsoft.com/Forums/en-US/netfxbcl/thread/10027dd8-da47-4691-91a6-a8b89a7f514a

Anyone know a possible answer / solution? Funny thing is that I have 2 collections in my serializable class (binary serialization). One is List, one is Dictionary. The List collection is OK, Dictionary returns 0 as Count property on [Deserialized] method.

What is even more bizarre is that after deserialization, working with the class object is OK. All unit tests against the Dictionary collection passes. It's frustrating me to no end because I want to work with the Dictionary object right after deserialization, but I can't due to this strange error. Can someone help?

+1  A: 

Yes; see here; you just need to ask the dictionary to finish deserialization:

public void OnDeserialization(object sender)
{
        this.Dictionary.OnDeserialization(sender);
}
Marc Gravell
You have no idea how much time I spent on this. Thank you so much for it. I can finally rest and move on to coding cool features.
Echiban