title: How can I correctly modify a generated XSD to overcome a known .Net bug that causes exception "cs0030:Unable to generate a temporary class"
body: <p>I have been tasked to send data to a 3rd Party web service, they have provided a test service that is proven to work with a Java client, however, it doesn't in .Net.</p>
  
  <p>When I generate the service proxy and either instantiate the service or serialise the request object, I get the following error:</p>
  
  <pre><code>Unable to generate a temporary class (result=1). 
  error CS0030: Cannot convert type 'TestStarXML.wsStarService.VSOptionInclusiveSetType[]' to 'TestStarXML.wsStarService.VSOptionInclusiveSetType' 
  error CS0030: Cannot convert type 'TestStarXML.wsStarService.VSOptionConflictSetType[]' to 'TestStarXML.wsStarService.VSOptionConflictSetType'
  error CS0030: Cannot convert type 'TestStarXML.wsStarService.ColorRequirementSetType[]' to 'TestStarXML.wsStarService.ColorRequirementSetType' 
  error CS0030: Cannot convert type 'TestStarXML.wsStarService.ColorExclusionSetType[]' to 'TestStarXML.wsStarService.ColorExclusionSetType' 
  error CS0029: Cannot implicitly convert type 'TestStarXML.wsStarService.VSOptionInclusiveSetType' to 'TestStarXML.wsStarService.VSOptionInclusiveSetType[]' 
  error CS0029: Cannot implicitly convert type 'TestStarXML.wsStarService.VSOptionConflictSetType' to 'TestStarXML.wsStarService.VSOptionConflictSetType[]' 
  error CS0029: Cannot implicitly convert type 'TestStarXML.wsStarService.ColorRequirementSetType' to 'TestStarXML.wsStarService.ColorRequirementSetType[]' 
  error CS0029: Cannot implicitly convert type 'TestStarXML.wsStarService.ColorExclusionSetType' to 'TestStarXML.wsStarService.ColorExclusionSetType[]'
  </code></pre>
  
  <p>The 3rd Party that sent us this service uses Java, and they had no problem generating the service proxy from the test service. My understanding so far is that there is a bug in .Net (<a href="http://connect.microsoft.com/VisualStudio/feedback/details/471297" rel="nofollow noreferrer">see here</a>) generating the XSD for the WSDL file.</p>
  
  <p>In the answer <a href="https://stackoverflow.com/a/7581988/198048">here</a>, it mentions modifying the generated XSD with dummy attributes, so I added the dummy attribute as suggested:</p>
  
  <pre><code>&lt;xs:complexType name="VSInclusivesOptionType"&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element minOccurs="0" maxOccurs="unbounded" name="VSOptionInclusiveSet" type="tns:VSOptionInclusiveSetType" /&gt;
      &lt;/xs:sequence&gt;
      &lt;xs:attribute name="tmp" type="xs:string" /&gt;   &lt;!-- this is all I have added (for each of the types in the exception message) --&gt;
    &lt;/xs:complexType&gt;
    &lt;xs:complexType name="VSOptionInclusiveSetType"&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element minOccurs="0" name="SetID" type="ns2:IdentifierType" /&gt;
        &lt;xs:element minOccurs="0" name="NumberOfOptionsNumeric" type="xs:decimal" /&gt;
        &lt;xs:element minOccurs="0" maxOccurs="unbounded" name="VSOption2" type="tns:VSOption2Type" /&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  </code></pre>
  
  <p>The only thing adding the dummy attribute achieved was to reduce the compile time of the project from minutes to seconds.</p>
  
  <p>Other than this, VS2008 didn't seem to notice the changes - I still can't serialise the object or instantiate the service without getting the exception mentioned above, what am I missing or doing wrong?</p>