I’m trying to XML-serialize a class the properties of which I use to format a document.
Basically, it is a class for the document’s header and another class for its rows.
Class diagram:

In this class diagram, the class I want to serialize is ExcelPrintCorte that inherits its methods from ExcelCabec and has a private member ExcelPrintDocumento (and a public method to get it).
My purpose is to XML-serialize ExcelPrintCorte and save the inherited properties’ values and also the properties’ values of ExcelPrintDocumento. I followed many guides to XML-serialize an object but it saves nothing but:
<?xml version="1.0" encoding="utf-8"?>
<ExcelPrintCorte xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
So, what am I doing wrong? Or is what I’m trying to do not possible with XML serialization?
Impossible to tell without code, but:
get-only orreadonly[XmlIgnore]is ignored, and a few other rules like[DefaultValue],ShouldSerialize{foo}etc are observedThose are the rules that would stop anything showing; other errors that would cause exceptions (check the inner-exceptions etc):
[XmlInclude])object, dictionaries, lists without an obviousAdd, etc