I have the following class which I want to serialize to XML:
<Serializable()> _
Public Class Settings
Public Shared var1 As Boolean = False
Public var2 As Boolean = False
End Class
I create a new instance and serialize it using my own method…
SaveSerialXML(PathToFile, New Settings, GetType(Settings))
…however the shared (static) variable is not included in the output:
<?xml version="1.0" encoding="utf-8"?>
<Settings>
<var2>false</var2>
</Settings>
Does anyone know of a way to serialize shared members of a class to XML?
Serialization is about serializing instances.
Sharedvariables do not belong to an instance.