How can I force the use of an xsi:type attribute?
问题 How can I force .NET's XmlSerializer to add an xsi:type="FooClass" to a member/node of type FooClass ? The scenario is a currently-released app, where in v.1 : FooClass inherits FooBaseClass FooPropertyA is on FooBaseClass FooPropertyB is on FooClass FooBaseClass is decorated with [XmlInclude(typeof(FooClass))] BazClass has member Foo of type FooBaseClass All sets of Baz.Foo are to a FooClass instance All usages of Baz.Foo expect FooPropertyB (and so a FooClass instance vs FooBaseClass) The