XSD.exe: Error generating classes for schema 'MySchema.xsd'. - The element 'http://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 (8)

  1. Sam says:

    Thanks man, you rock!  This was kicking my tail for the last 30 minutes.

  2. Pat says:

    Thanks a lot.

    I was wasting my time since a long time

    Great job dude 🙂

  3. LocTeam says:

    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.

  4. Martin says:

    Lifesaver..... can move onto the next roadblock 😛

  5. Pramod says:

    Excellent article.. I was struggling to create the class from xsd... it helped!! Thanks so much for posting

  6. Filippo says:

    Thank you so much for this useful tip!

  7. Fan says:

    This saved so much time! Thank you!

Skip to main content