I tried using XmlSerializer, but XmlSerializer will not serialize a TimeSpan value; it just generates an empty tag for timespans (otherwise would have been perfect).
So then I tried using SoapFormatter, but SoapFormatter will not serialize generic lists; that just results in an exception.
What other options do I have? I can’t make any change to the class of the object I’m serializing because it’s generated from a service reference. So any workarounds that involve changing the class are out.
Do I have no choice but to implement a custom serializer? Are there any external tools I could use?
You can use DataContractSerializer
Result: