title: creating class object with included schema using xsd.exe
body: <p>I have received a XSD schema MainSchema.XSD and also Common.Xsd schema.</p>
  
  <p>In MainSchema.xsd i have a following line:</p>
  
  <pre><code>&lt;xs:include schemaLocation="Common.xsd"/&gt;
  </code></pre>
  
  <p>And Common.Xsd hold a definition for various types of data like:</p>
  
  <pre><code>&lt;xs:simpleType name="SSN"&gt;
      &lt;xs:annotation&gt;
          &lt;xs:documentation&gt;Social security number is 10 digits&lt;/xs:documentation&gt;
          &lt;xs:appinfo&gt;
              &lt;altova:exampleValues&gt;
                  &lt;altova:example value="5412983209"/&gt;
                  &lt;altova:example value=""/&gt;
              &lt;/altova:exampleValues&gt;
          &lt;/xs:appinfo&gt;
      &lt;/xs:annotation&gt;
      &lt;xs:restriction base="xs:string"&gt;
          &lt;xs:whiteSpace value="collapse"/&gt;
          &lt;xs:pattern value="([0-9]{10})?"/&gt;
      &lt;/xs:restriction&gt;
  &lt;/xs:simpleType&gt;
  </code></pre>
  
  <p>and in MainSchema i have a property called SSNField of type SSN:</p>
  
  <pre><code>&lt;xs:attribute name="CompanySSN" type="SSN"&gt;
      &lt;xs:annotation&gt;
          &lt;xs:documentation&gt;SSN number of Company&lt;/xs:documentation&gt;
      &lt;/xs:annotation&gt;
  &lt;/xs:attribute&gt;
  </code></pre>
  
  <p>When i create a c# object class with this command:</p>
  
  <p><strong>xsd.exe -c -l:c# MainSchema.xsd Common.Xsd</strong></p>
  
  <p>it then created a object called:</p>
  
  <p><strong>MainSchema_Common.cs</strong></p>
  
  <p>When i validate an object against this Schema it comes up with an Exception:</p>
  
  <p><strong>{"Type 'http://schemas.domain.com:SSN' is not declared, or is not a simple type."}</strong></p>
  
  <p>Does anyone knows what i´m doing wrong ?</p>
  
  <p>Bear in mynd that i received this XSD schemas from a outside source and i was told that there were no errors in this files.</p>
  
  <p>Sincerly
  agh</p>