Why does xsd.exe generate string property for xs:integer?
问题 When I generate a c# class from a xsd schema with xsd.exe I find this behaivor a bit wierd. My element: <xs:element name="InvoiceNo" type="xs:integer"/> is generated to: [System.Xml.Serialization.XmlElementAttribute(DataType="integer", Order=5)] public string InvoiceNo { ... } Why is that property not generated as an int instead of string ? 回答1: This behavior is by design: The xs:integer type is specified as a number with no upper or lower bound on its size. For this reason, neither XML