Your variables are all private. XmlSerializer
can only serialize public properties and fields. From the documentation:
XML serialization is the process of converting an object's public properties and fields to a serial format (in this case, XML) for storage or transport.
and later:
To control the generated XML, you can apply special attributes to classes and members. For example, to specify a different XML element name, apply an
XmlElementAttribute
to a public field or property, and set theElementName
property.
I suggest that you convert your private fields into public properties (not public fields).