cs0030:无法生成临时类 [英] cs0030:Unable to generate a temporary class

查看:393
本文介绍了cs0030:无法生成临时类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Web服务,当我尝试生成它我收到以下错误的对象。

I have a Web Service, when I try to generate the object of it I am getting below error.

无法生成临时类(结果= 1).error CS0030:无法将类型'ShortSell.ShortSellRQOriginDestinationInformationFlightSegment []'到'ShortSell.ShortSellRQOriginDestinationInformationFlightSegment'error CS0030:无法将类型'ShortSell.ShortSellRSOriginDestinationOptionFlightSegment []'到'ShortSell.ShortSellRSOriginDestinationOptionFlightSegment'error CS0030:无法将类型'ShortSell.ShortSellRQOriginDestinationInformationFlightSegment []'到'ShortSell.ShortSellRQOriginDestinationInformationFlightSegment'error CS0029:无法隐式转换类型'ShortSell.ShortSellRQOriginDestinationInformationFlightSegment'到'ShortSell.ShortSellRQOriginDestinationInformationFlightSegment []'错误CS0029:无法隐式转换类型'ShortSell.ShortSellRSOriginDestinationOptionFlightSegment'到' ShortSell.ShortSellRSOriginDestinationOptionFlightSegment []'错误CS0029:无法隐式转换类型'ShortSell.ShortSellRSOriginDestinationOptionFlightSegment'到'ShortSell.ShortSellRSOriginDestinationOptionFlightSegment []'}

"Unable to generate a temporary class (result=1).error CS0030: Cannot convert type 'ShortSell.ShortSellRQOriginDestinationInformationFlightSegment[]' to 'ShortSell.ShortSellRQOriginDestinationInformationFlightSegment'error CS0030: Cannot convert type 'ShortSell.ShortSellRSOriginDestinationOptionFlightSegment[]' to 'ShortSell.ShortSellRSOriginDestinationOptionFlightSegment'error CS0030: Cannot convert type 'ShortSell.ShortSellRQOriginDestinationInformationFlightSegment[]' to 'ShortSell.ShortSellRQOriginDestinationInformationFlightSegment'error CS0029: Cannot implicitly convert type 'ShortSell.ShortSellRQOriginDestinationInformationFlightSegment' to 'ShortSell.ShortSellRQOriginDestinationInformationFlightSegment[]'error CS0029: Cannot implicitly convert type 'ShortSell.ShortSellRSOriginDestinationOptionFlightSegment' to 'ShortSell.ShortSellRSOriginDestinationOptionFlightSegment[]'error CS0029: Cannot implicitly convert type 'ShortSell.ShortSellRSOriginDestinationOptionFlightSegment' to 'ShortSell.ShortSellRSOriginDestinationOptionFlightSegment[]'"}

我试图改变临时文件夹的属性为可写,但我仍然收到此错误。 ?为什么我得到这个错误,我怎么能解决这个问题。

I tried changing the temp folder properties to writable but I am still getting this error. Why am I getting this error and how can I fix it?

推荐答案

这是一个已知的bug不会被固定的:

It's a known bug that won't be fixed:

  • Microsoft Connect: XmlSerializer Code Generation component cannot handle nested unbounded elements when there is only one element

发生错误时的复杂类型的WSDL包含无界发生只有一个元素。解决方法,从这个论坛讨论 (信贷埃琳娜Kharitidi),是虚拟属性添加到这些类型的:

The error occurs when a complex type in the wsdl contains exactly one element with unbounded occurrence. The workaround, taken from this forum discussion (credit to Elena Kharitidi), is to add dummy attributes to such types:

<xs:sequence maxOccurs="unbounded">
  <xs:element ../>
<xs:sequence>
<xs:attribute name="tmp" type="xs:string" />      <-- add this

<xs:sequence>
  <xs:element maxOccurs="unbounded"/>
<xs:sequence>
<xs:attribute name="tmp" type="xs:string" />      <-- add this

这篇关于cs0030:无法生成临时类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆