XSD.exe: Error generating classes for schema 'MySchema.xsd'. - The element 'https://schemas.DomainName.com/types:MyType' is missing.
If you are getting this kind of error it is probably because the XSD.exe utility is not following imports and/or includes in your XSD. To solve this issue, specify all the required XSD files directly on the command line as follows:
xsd.exe /c MySchema.xsd Import01.xsd Import02.xsd Include01.xsd Include02.xsd
where Import01.xsd, Import02.xsd, Include01.xsd and Include02.xsd are XSD files referenced via import and include elements in MySchema.xsd.
Comments
Anonymous
February 20, 2008
PingBack from http://msdnrss.thecoderblogs.com/2008/02/20/xsdexe-error-generating-classes-for-schema-myschemaxsd-the-element-httpschemasdomainnamecomtypesmytype-is-missing/Anonymous
August 20, 2008
Thanks man, you rock! This was kicking my tail for the last 30 minutes.Anonymous
June 17, 2009
Thanks a lot. I was wasting my time since a long time Great job dude :)Anonymous
June 08, 2010
Check all the .xsd files in your source files directory.Your command will be something like xsd.exe /c MySchema.xsd ..........xsd. Press enter and it will generate your class.Anonymous
August 01, 2013
Lifesaver..... can move onto the next roadblock :PAnonymous
January 10, 2015
Excellent article.. I was struggling to create the class from xsd... it helped!! Thanks so much for postingAnonymous
January 28, 2015
Thank you so much for this useful tip!Anonymous
March 09, 2016
This saved so much time! Thank you!