. . . or respect the IsError property.
I found a problem in some code today. The class is a data-holder for XML serialization. One property has been deprecated and attributed with the ObsoleteAttribute to produce a compile-time warning for developers. Previous versions of the XML data must still be readable, but we want to make sure all of our code uses the correct property.
I assumed that on XML-deserialization, the property-setter would be respected; however, it is not.
This is wrong.
If a member is marked as obsolete with warning (i.e., deprecated) it should still be observed. This is the case throughout .NET 2.0: deprecated members continue to function compatibly.
The only way that I can see the XmlSerializer observing this attribute is if IsError == true; however, even this is a stretch. Really, this attribute should only impact compilation, not runtime.
Better yet, if a user wants a new version to exclude deserialization, we already have an attribute for that: the XmlIgnoreAttribute.
Argh.





