title: Xsd.exe is unable generate class when Importing ComplexType
body: <p>I am trying to run Xsd.exe on a XSD file and I am getting following error. I am using IMPORT because host-namespace is different from foreign-namespace. </p>
  
  <p>A2.xsd depends on A21.xsd, which in turn depends on A22.xsd (all are in same folder)</p>
  
  <pre><code>ERROR: "The datatype 'http://service.a1.com/base1/2005/:EmployeeDefinition' is missing"
  
  xsd.exe /classes /out:C:\Temp\ "C:\Temp\A2.xsd" /language:CS
  </code></pre>
  
  <p>A2.xsd</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://service.a1.com/base/2005/" xmlns:c1="http://service.a1.com/base1/2005/" elementFormDefault="qualified"&gt;
    &lt;xs:import namespace="http://service.a1.com/base1/2005/" schemaLocation="a21.xsd"/&gt; 
    &lt;xs:element name="Employee" nillable="true" type="c1:EmployeeDefinition" /&gt;
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>A21,xsd</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://service.a1.com/base1/2005/" xmlns:n2="http://service.a1.com/base2/2005/" elementFormDefault="qualified"&gt;
   &lt;xs:import namespace="http://service.a1.com/base2/2005/" schemaLocation="a22.xsd"/&gt; 
   &lt;xs:complexType  name="EmployeeDefinition"&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element minOccurs="1" maxOccurs="1" name="EmployeeID" type="xs:int" /&gt;
        &lt;xs:element minOccurs="0" maxOccurs="1" name="FirstName" type="xs:string" /&gt;
        &lt;xs:element name="Address" nillable="true" type="n2:AddressDefinition" /&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>A22.xsd</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://service.a1.com/base2/2005/" elementFormDefault="qualified"&gt;
    &lt;xs:complexType name="AddressDefinition"&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element minOccurs="1" maxOccurs="1" name="HouseNumber" type="xs:int" /&gt;
        &lt;xs:element minOccurs="0" maxOccurs="1" name="StreetName" type="xs:string" /&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>Please let me know what is going on here.</p>