ASP.NET: Generating serialization class for XML without Xsd2Code

While there’s a free tool on Codeplex called Xsd2Code that gives you nice integration to Visual Studio’s right click menu to generate serialization class based on an XSD file, Visual Studio itself also includes a similar command line tool – the XML Schema Definition Tool (xsd.exe).

Once you have your XSD file generated from your XML file, open the Visual Studio Command Prompt and type:

xsd <YourFileName>.xsd  /c /l:cs

This will generate a C# class in the same folder with the same name as your XSD file.

Type xsd /? for more information about this tool or check the MSDN page.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s