What\'s the simplest way to get XmlSerializer to also serialize private and \"public const\" properties of a class or struct? Right not all it will output for me is things
Even though it's not possible to serialize private properties, you can serialize properties with an internal setter, like this one :
public string Foo { get; internal set; }
To do that, you need to pre-generate the serialization assembly with sgen.exe, and declare this assembly as friend :
[assembly:InternalsVisibleTo("MyAssembly.XmlSerializers")]