Sham
Sham

Reputation: 691

clarification on System.Runtime.Serialization

Please share your view of System.Runtime.Serialization.

My questions and doubts are:

  1. Class and all it's containing objects must have [Serializable] keyword on top of the class.
  2. What if some object is of static type.
  3. How Serialization handles static object.
  4. 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.

Upvotes: 0

Views: 103

Answers (2)

Buzz
Buzz

Reputation: 6330

Serialization is a extremely wide topic and you are not asking a single question.
i would suggest start reading msdn library ,it would give you a good start-
http://msdn.microsoft.com/en-us/library/7ay27kt9(v=vs.100).aspx
http://msdn.microsoft.com/en-us/magazine/cc301761.aspx

Upvotes: 1

Martin
Martin

Reputation: 584

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

Upvotes: 0

Related Questions