Last Updated: September 29, 2021
·
1.913K
· danny_thorpe

XSD.EXE error "Cannot instantiate an abstract ComplextType for the node . "

If you’re trying to generate classes or a dataset from an XSD schema file using the Visual Studio XSD.EXE command line utility and the only thing you’re getting out of XSD.EXE is an error message of

Error: There was an error processing 'xyz-schema.xml'.
  - DataSet cannot instantiate an abstract ComplexType for the node .

Here’s your solution: Rename your schema file from *.xml to *.xsd.

When you give XSD an input file with a .xml extension, it assumes you want to infer schema from data found in the xml file. If what you really want is for XSD to read the schema from the input file, the input file has to have a file extension of .xsd.

Since XSD schema is formatted as an XML document, its not uncommon to find XSD schema in files with a .XML extension, especially when downloading from the web. Just remember to rename them to .xsd before generating classes from them.

Original post: http://dannythorpe.com/2011/01/13/visual-studio-xsd-error/