I am trying to serialize an object using XmlSerializer. The input class that has a property with [XmlAttribute] is not showing up in output xml. Anyway to fix this?
For it not to appear at all, one of these things is usually true:
public
getter and setter; if it lacks both: it will not be serialized (note that for collections, only a getter is required) [DefaultValue]
, or a ShouldSerialize*()
method), and is indicating to omit it [XmlIgnore]
, for example)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.