I'm trying to serialize/deserialize a persistent object using the method described here:
How to: Serialize and Deserialize Objects
Only difference is that I'm using a binary formatter instead of xml.
This seems to work fine for serialization, but fails on deserialization.
My class implements ISerializable and in GetObjectData() everything is executed as expected.
However, when the deserialization constructor(info, context) is called, my persistent collections have been changed into TrackedList<T>.
My Collection class contains lots of logic to handle the collection items, and this won't work when serialized/deserialized to another tier.
Save/Load of class handles this fine (as long as I declare the field as IList<MyClass> m_Classes = new MyClassCollection() (which inherits from TrackedList<T>).
Another thing that I noticed is that on serialization, the IInstanceCallBack.PostLoad() method is called on the same referene instance I'm serializing (cheked this using GetHasgCode()). I would expect this behaviour on de-serialization, but not on serialization.