I'm trying to deserialize an object back from it's XML string using xmlSerializer.Deserialize() but the returned object is always blank (not null, but all the properties are null or 0). I can't work out what I'm doing wrong and yet I get no errors or exceptions.
string xml = "***my xml is here***";
XmlSerializer ser = new XmlSerializer(typeof(Order));
StringReader stringReader = new StringReader(xml);
XmlTextReader xmlReader = new XmlTextReader(stringReader);
Order order = (Order)ser.Deserialize(xmlReader);
xmlReader.Close();
stringReader.Close();
The source of Order.cs was generated from the XSD using the the xsd.exe tool.
Source of order.cs: http://www.nickgilbert.com/etc/1/Order.txt
Sample order XML: http://www.nickgilbert.com/etc/1/example-order.xml