Settings in an XML file

Dec 27, 2012 at 7:16 PM

After looking through code, I discovered that when you use the command line, you can specify settings in an XML file.  That file must be called <myfilename>.xsd.xsd2code and you must run the executable as such:


> xsd2code.exe <myfilename>.xsd

Note - you cannot specify any other arguments.

The .xsd.xsd2code file should look something like this (note, you can copy the XML at the top of the generated source code file):



Jan 22, 2013 at 10:15 PM


I'm the submitter who added this feature. Once upon a time there was some documentation on it. But I don't see the documentation anymore but it works like this:


The code will look for settings in 3 Locations in this order.

  1. [schemafilename].xsd.xsd2code if it exists and will use this file always for that schema. This represents Schema specific Settings.
  2. the header of the generated [schemaFilename].designer.[cs/vb] file if you've already run xsd2Code at least once.
  3. and finally a defaults.xsd2code file located in the same directory as the XSD file., if an only if neither of the other 2 files exists.

When using this from the command line, it functions when only the XSD file name is specified (arguments == 1)