Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate .NET 4.0 classes from xsd?

Tags:

c#

.net

xsd

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

like image 729
Bastien Vandamme Avatar asked Mar 07 '11 08:03

Bastien Vandamme


People also ask

Can we generate XML from XSD?

To create an XML file from an XSD file: Right-click the XML Documents folder in your data development project, and select New > XML. The New XML File wizard opens. Select the XMLSchema project in the parent folder field, type customer.


1 Answers

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.

like image 145
Marc Gravell Avatar answered Sep 26 '22 10:09

Marc Gravell