According to mspress (MCTS for exam 70-536.NET 2.0):
You may have version compatibility issues if you try to deserialize an object that was serialized by an earlier version of your application. In particular, if you add an element to a custom class and try to deserialize an object that does not have this member, the runtime will throw an exception. In other words, if you add a member to the version 3.1 class of your application, he will not be able to deserialize the object created in version 3.0 of your application.
Now ... Oddly enough, I went and created a project, serialized the class, added a new member and tried to deserialize the class for a new object. To my surprise, this worked, and the newly created member was set to the default by default (even if it had a different default value).
First I tried adding String as a new member, seeing that it worked, and then changing it to another custom class, and it still worked.
Is mspress wrong? Or is this behavior customizable?
Please note that I am NOT using XML serialization. I am using BinaryFormatter Serialization.
source
share