I use a XmlSerializer
to serialize/deserialize some objects. The problem is the performance. When profiling, using the XmlSerializer
make our application 2 seconds longer to start. We cache our XmlSerializer and reuse them. We cannot use sgen.exe because we are creating the XmlSerializer with XmlAttributeOverrides
.
I try to use serialization alternative like Json.Net and, at first, it's work great. The problem is that we need to be backward compatible so all the xml already generated need to be parsed correctly. Also, the object serialization output must be Xml.
To summarize:
- I receive Xml data serialized by a XmlSerializer.
- I need to deserialize the Xml data and convert it into an object.
- I need to serialize object into Xml (ideally an Xml format like the one a XmlSerializer would have done)