Ignoring a property during deserialization

I have a class that serializes very well - finally!

Now I want to add a property to this class that I don't want to serialize at all.

Is it possible to add this new property with some kind of attribute, so that when calling serialization or deserialization methods, this property will go unnoticed?

+6
c # xml serialization
source share
2 answers
[XmlIgnore] public int DoNotSerialize { get { ... } set { ... } } 
+16
source share

I think you are looking for the [XmlIgnore] attribute

+2
source share

All Articles