I’ve inherited some code that declares several private fields with both [XmlIgnore()] and [XmlAttributeAttribute()]. Is it safe to assume that XmlIgnoreAttribute takes precedence and I can just remove the XmlAttributeAttribute?
I’ve inherited some code that declares several private fields with both [XmlIgnore()] and [XmlAttributeAttribute()]
Share
[XmlIgnore] takes precedence if you’re using the XmlSerializer, so if this is what you’re using to serialize those classes, then you can safely remove the [XmlAttribute] from the fields. But if it’s possible that some custom serializer is being used, then you’d have to check with the rules for this other serializer as well.