Code Project

Link Unit

Thursday, July 23, 2015

Unable to generate a temporary class (result=1)

While trying to Invoke Web Services we faced following error:
Error:
Unable to generate a temporary class (result=1).
error CS0029: Cannot implicitly convert type '
WebServices.Proxy.CustomType' to 'WebServices.Proxy.CustomType[]'
error CS0030: Cannot implicitly convert type '
WebServices.Proxy.CustomType[]' to 'WebServices.Proxy.CustomType'

 Cause

A known issue with WSDL.exe can cause a proxy class to be generated incorrectly if an array of complex type includes an element that is also an array of complex type and for which only one element exists.

Resolution:

We need to open reference.cs file and change respective customtype from double dimension to single dimension. Rebuild the project and it started working fine.