Please share your view of System.Runtime.Serialization.
My questions and doubts are:
- Class and all it’s containing objects must have [Serializable] keyword on top of the class.
- What if some object is of static type.
- How Serialization handles static object.
- How dll versioning affects the serialized object. (e.g. i have serialized one object and later uploaded new build on server in that case does there is any effect on previously serialized object.)
Thanks in advance.
1) Not all members need to be serializable you can tag them with
[NonSerialized()]2, 3) Static won’t work, see serialize-a-static-class
4) My experience with serialization is that any change in the serialized object will break the deserialization.
UPDATE: The comment from Jon Skeet (thats me learning something new) does handle 4). But pay attention to the botom of the site. You have to be very careful about changing attributes
Version Tolerant Serialization