My desktop application serializes objects using XmlSerializer
. I was suggested to leverage DataContractSerializer
instead.
Under which scenario
Dan Rigsby has the ultimate post on this - go read it!
XmlSerializer vs. DataContractSerializer (web archive)
He says all there is to say, and in a very convincing way.
In short:
XmlSerializer:
DataContractSerializer is:
[DataMember]
will be serialized[DataMember]
will be serialized - whether it's public
or private