Prevent XmlSerializer from emitting xsi:type on inherited types
问题 I have managed to serialize a class that inherits from a base class to XML. However, the .NET XmlSerializer produces an XML element that looks as follows: <BaseType xsi:Type="DerivedType" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> This, however, causes the receiving end of a web service to choke and produce an error that amounts to: sorry we do not know "DerivedType". How can I prevent the XmlSerializer from emitting the xsi:Type attribute? Thanks! 回答1: You can use the XmlType