cs0030:无法生成临时类

我有一个Web服务,当我尝试生成它的对象时,我遇到了错误。

“无法生成临时类(result = 1).error CS0030:无法将类型’ShortSell.ShortSellRQOriginDestinationInformationFlightSegment []’转换为’ShortSell.ShortSellRQOriginDestinationInformationFlightSegment’error CS0030:无法将类型’ShortSell.ShortSellRSOriginDestinationOptionFlightSegment []’转换为’ShortSell.ShortSellRSOriginDestinationOptionFlightSegment ‘错误CS0030:无法将类型’ShortSell.ShortSellRQOriginDestinationInformationFlightSegment []’转换为’ShortSell.ShortSellRQOriginDestinationInformationFlightSegment’error CS0029:无法隐式转换类型’ShortSell.ShortSellRQOriginDestinationInformationFlightSegment’为’ShortSell.ShortSellRQOriginDestinationInformationFlightSegment []’错误CS0029:无法隐式转换类型’ShortSell。 ShortSellRSOriginDestinationOptionFlightSegment’to’ShortSell.ShortSellRSOriginDestinationOptionFlightSegment []’错误CS0029:无法将类型’ShortSell.ShortSellRSOriginDestinationOptionFlightSegment’隐式转换为’ ShortSell.ShortSellRSOriginDestinationOptionFlightSegment []’“}

我尝试将临时文件夹属性更改为可写但我仍然收到此错误。 为什么我会收到此错误,我该如何解决?

这是一个无法修复的已知错误:

  • 当只有一个元素时, Microsoft Connect: XmlSerializer代码生成组件无法处理嵌套的无界元素

当wsdl中的复杂类型恰好包含一个具有无限发生的元素时,会发生错误。 从这个论坛讨论 (信用到Elena Kharitidi)获取的解决方法是为这些类型添加虚拟属性:

    <-- add this 

     <-- add this 

在我的wdsl中没有“xs:sequence”元素,所以我无法直接应用wsdl文件更改。 但是,我通过参考下面的post修复了这个问题。

https://stackoverflow.com/a/27507816/503446