I’m playing with serialization (specifically XmlSerializer) and am slightly confused.
The class I intend to serialize has the attribute:
[System.SerializableAttribute()]
This is great, but when I derive from the class, I can still serialize the derived class?
This is odd because I thought attributes weren’t inherited to the derived class?
Secondly, to compound my confusion, I created just a standard class that didn’t inherit from anything, nor did I mark it with any attributes, and I could still serialize it?
SerializableAttributedoes not affectXmlSerializer. This attribute is for other serialization formats such as theBinaryFormatter.