I am currently using XmlSerializer to serialize and deserialize an object. Xml is generated in undefined order, which is understandable, but makes it annoying when comparing versions of an object, since the order of the properties is different every time. So, for example, I cannot use the usual diff tool to see any differences.
Is there an easy way to generate my xml in the same order every time without writing the ReadXml and WriteXml methods themselves? I have many properties in the class and every time I add new ones, so I prefer not to write or support this code.
(C # .net 2.0)
Rory
source share