2011-09-28 80 views
12

我有一個Web服務,當我嘗試生成它的對象時,我得到下面的錯誤。cs0030:無法生成臨時類

「無法生成臨時類(結果= 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.ShortSellRSOriginDestinationOptionFlightSeg包換」到‘ShortSell.ShortSellRSOriginDestinationOptionFlightSegment []’錯誤CS0029:無法隱式轉換類型‘ShortSell.ShortSellRSOriginDestinationOptionFlightSegment’到‘ShortSell.ShortSellRSOriginDestinationOptionFlightSegment []’「}

我試圖改變的臨時文件夾的屬性爲可寫,但我仍然得到這個錯誤。爲什麼我得到這個錯誤,我該如何解決它?

+0

以下線程似乎涵蓋了這個確切的問題。也許那裏發佈的解決方案也適用於你的情況? http://forums.asp.net/t/1469891.aspx/1 – Heinzi

+0

是的,Heinzi似乎相同,但任何suggetions我應該做什麼,因爲我無法找到任何解決方案? – Reaves

+1

讀取「*這個解決方案的部分是如何運行wsdl映射文件並全部從[] [] ---> [] *」更改? – Heinzi

回答

23

這是一個已知的bug不會被固定:

當WSDL複雜類型包含無界發生的一個要素出現的錯誤。解決方法,從this forum discussion採取(信用埃萊娜Kharitidi),是虛擬屬性添加到這些類型:

<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 
+2

花費時間尋找這個偉大的答案 – bubblebath

+3

微軟非常重視不修復它們的錯誤。該錯誤仍然存​​在。感謝您的好答案 –

+1

近3年後,這仍然是必需的,這很荒謬。嗯 - 謝謝:) – Archer