1

My question is very much like this one. However, I need to allow two different namespaces on the same root.

Something like:

    [XmlType(Namespace = "")]
[XmlRoot("included_parameters", Namespace = "http://apif.freescale.net/schemas/paramdef/1.0")]
[XmlRoot("included_parameters", Namespace = "http://apif.freescale.net/schemas/paramdef/1.1")]
public class IncludedParameters
{
}

So basically, I want to deserialize an xml file for version 1.0 of the schema ot 1.1 of the schema into the same .net class.

Please let me know if you need more details.

Chris

1 Answers1

0

There is a SerializationBinder class that let one do this kind of type conversion operation.

https://msdn.microsoft.com/en-us/library/system.runtime.serialization.serializationbinder%28v=vs.110%29.aspx

"Some users need to control which class to load, either because the class has moved between assemblies or a different version of the class is required on the server and client"
Amit Kumar Ghosh
  • 3,618
  • 1
  • 20
  • 24