How to generate .NET 4.0 classes from xsd?

Bastien Vandamme picture Bastien Vandamme · Mar 7, 2011 · Viewed 379.4k times · Source

What are the options to generate .NET 4.0 c# classes (entities) from an xsd file, using Visual Studio 2010?

Answer

Marc Gravell picture Marc Gravell · Mar 7, 2011

simple enough; just run (at the vs command prompt)

xsd your.xsd /classes

(which will create your.cs). Note, however, that most of the intrinsic options here haven't changed much since 2.0

For the options, use xsd /? or see MSDN; for example /enableDataBinding can be useful.