My bad, it seems that xsd.exe does not resolve schema imports. From this article :
Now that the type has been defined in another file, the xsd.exe will generate this error if you attempt to create the create the Request XML: C:\Solution\Project>xsd.exe Request.xsd /c Schema validation warning: Type 'http://www.Example.com/Types:Meeting' is not declared. Warning: Schema could not be validated. Class generation may fail or may produce incorrect results. Error: Error generating classes for schema 'C:\Solution\Projects\Request'.
- The datatype 'http://www.Example.com/Types:Meeting' is missing. If you would like more help, please type "xsd /?". This is due to the fact that the xsd.exe does not use the schemaLocation hint to find the imported schema. You’ve got to include it as a parameter. in your xsd.exe call: C:\Solution\Project>xsd.exe Types.xsd Request.xsd /c