xsd command and multiple xsd files

I use the .net xsd command heavily but this is the first time that I have needed to generate a class when the xsd itself references other xsd files.

When I run the command as I normally use:

xsd /c <Name of the XSD file>

With multiple XSD imports though I get an error saying ‘Error: Error generating classes for schema’ due to it not being able find the externally referenced types.

The answer found here is to add the referenced xsd files to the end of the command like so:

xsd /c <Name of the XSD file> <Referenced file 1> <Referenced file 2> ..

This generates a file properly but it has a name created from the concatenation of all the xsd files involved:

<Name of the XSD file><Referenced file 1><Referenced file 2>.xsd

Simple rename of the file to something less verbose and all works fine.

One thought on “xsd command and multiple xsd files

  1. Pingback: Recent Links Tagged With "xsd" - JabberTags

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>