Try using svcutil
; it can handle the circular references.
In the following example, eExact-Schema.xsd
is an XSD that xsd.exe
cannot handle.
Example:
C:SRCExact>svcutil eExact-Schema.xsd /language:C# /dataContractOnly /importxmltypes /out:exact.cs
This is always a good place to start; you can now use this class and alter to suit your style/needs, add comments, etc, and it will save you a lot of time/searching over doing it all from scratch.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…