How to generate XML Schema from C# type with XSD.exe such that [XmlAttribute] property is mapped to required XML attribute?
问题 Put it simply, when I use XSD.exe (that comes with Visual Studio 2012) to generate XML schema file from this class: [Serializable] public class Person { [XmlAttribute] public string Name { get; set; } [XmlAttribute] public int Age { get; set; } } I get this as the result: <?xml version="1.0" encoding="utf-8"?> <xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="Person" nillable="true" type="Person" /> <xs:complexType name="Person"> <xs