有没有一种方法来从C#.NET编程类的XSD?我想带类型信息的序列化对象的XSD(或XML)。
Is there a way to create an XSD from a C# .NET class programatically? I want to serialize objects to xsd (or xml) with type information.
是的;看 XsdDataContractExporter
; MSDN有一个full例如这里。
Yes; look at XsdDataContractExporter
; MSDN has a full example here.
替代; XmlSchemaExporter