Support of import in xsd.exe
I was trying to create a C# class with xsd.exe from an schema that imports others schemas like that xsd.exe /c schema.xsd and it fails miserably reporting an error like "The datatype 'xxx' is missing.". Basically xsd.exe doesn't resolve the schemaLocation attribute.
Dare Obasanjo's article addresses the problem, and Scott Hanselman had the same problem -and solved it-.
The solution isn't very nice, but at least it's simple. You have to tell xsd.exe all the schema referenced, xsd.exe /c schema.xsd importedSchema1.xsd importedSchema2.xsd
Comments
- Anonymous
June 03, 2004
Thank you, great help, I was looking for this. - Anonymous
October 08, 2015
I wrote a quick LinqPad script to make XSD do my bidding.. www.alexdresko.com/.../xsd-exe-and-imports-a-solution