Generate XSD from .NET Class within IDE

Been using XSD.exe for years from the command line to generate XSD.  Recently I decided to add it to the Visual Studio IDE so I can simply click the class file in solution explorer and generate an XSD.

  1. Open Visual Studio and go to Tools->External Tools
  2. Click Add and name the menu item “Class to XSD”
  3. Add the command, browse for XSD.exe
  4. Add arguments, $(BinDir)$(TargetName).dll /outputdir:$(ItemDir) /type:$(ItemFileName)

That’s it!  You should have something looking like the below.  To use it go to your .cs file in solution explorer and click it.  Then go to Tool->Class to XSD.  The .xsd files will be created in the same folder as your classes.

Screen Shot 2015-06-06 at 2.46.00 pm

Advertisements
This entry was posted in .NET, BizTalk Server, Tools. Bookmark the permalink.

One Response to Generate XSD from .NET Class within IDE

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