We make extensive use of xml serialization / deserialization in our project to transfer data between multiple applications. We have a regular xsd, which we will generate with C # classes, then use the XmlSerializer to move from xml to objects and vice versa.
The problem is updating one application to add new enumeration values, but the other application has not yet been updated. Now an application that is not updating tries to deserialize xml and fails because it does not know about the new enumeration.
If we have app1 and app2, everything works correctly in the field, then app2 is updated with the new enum value in xsd and updated by the client in the field. Suddenly, app1 breaks because it does not know about enum, app1 may not even use this enum field, it does not affect application1, but it still breaks.
Are there any known ways around this. Basically, what I want to do is determine what to do when the enumeration is not found, use the default value, or list as an invalid type and set it to null.
Both XmlSerializer and DataContractSerializer exceptions exclude this situation.
I reviewed the YAXLib XML serialization project ( http://www.codeproject.com/KB/XML/yaxlib.aspx ), this also throws an exception, but there is source code and can be changed. This project uses different property attributes and will require considerable changes, but it is probably possible.
Any other suggestions.
scott source share