« Serialization, Choosing between XML and Binary formatters. | Main | Performance Counters Pattern »

XML Serialization Support Reminders

Xml serialization annoyances:

NUnit framework seems to have a problem testing serialization. Complains about StrongNameIdentityPermission? Why?

Things not to forget:

1. public default constructor is required.

2. public fields need to be read/write (don’t forget setters, even if they are no-ops).

3. Public indexers cause serialization to fail with a reflection error. Use [XmlIgnore].

 

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)