I have the following situation. In my C # application, I have a class that I am serializing with XmlSerializer. The class is quite complex, and the object of my class is saved on the local disk as an application file, which can be opened later (classic save and re-work). My problem is that during development, the class of the object that is being serialized may change. I would like to have a version system that allows my application to understand that the saved xml belongs to the old version, but can be opened. Older versions of applications also cannot open new versions of xml.
For example:
class ComplexObject { public string settings1; public string settings2; }
I serialize the object, send the application to production. Tomorrow my class became
class ComplexObject { public string settings1; public string settings2; public string settings3; }
How my new version of the application will open serialized objects of old class definitions, as well as a new class definition without errors when loading a file into an object (deserialization)
Any suggestions and basic samples are welcome!
thanks
Iftemi alin
source share