We're using XmlSerializer to serialize our data objects for
persistence in a WinForms app. This is our primary data store, we're
not web connected and are not using a database. We've had to program
some of our classes in undesired ways to support XmlSerializer and
it's limitations (public new constructor, only public properties, no
dictionary support, etc).
We just came across a note in one of the articles on XML Serialization
that says you can work around some of these issues with a wrapper
class, but there's no link for more info. What is this talking about
and how can we better support XmlSerializer based persistence without
having to mess with our object model?
We've also looked at using the SoapTypeImporte r which provided little
additional benefit and the SoapFormatter which created undesirable XML
(one of the main reasons for using XmlSerializer is to allow
interoperabilit y with other non .net apps and simple XML is a big
plus).
Thanks,
Sam
XML Serialization in the .NET Framework
http://msdn.microsoft.com/library/de...ml01202003.asp
Q: How can I serialize classes that were not designed for XML
serialization if I do not want to use the SoapFormatter?
A: You can design special wrapper classes that expose or hide fields
and properties from the XmlSerializer.