Ignore property of a property in Xml Serialization in .NET using XmlSerializer
I am carrying out Xml serrialization using XmlSerializer . I am carrying out serialization of ClassA , which contains property named MyProperty of type ClassB . I don't want a particular property of ClassB to be serialized. I have to use XmlAttributeOverrides as the classes are in another library. If the property was in ClassA itself, it would have been straightforward. XmlAttributeOverrides xmlOver = new XmlAttributeOverrides(); XmlAttributes xmlAttr = new XmlAttributes(); xmlAttr.XmlIgnore = true; xmlOver.Add(typeof(ClassA), "MyProperty", xmlAttr); XmlSerializer ser = new XmlSerializer