【问题标题】:Unable to generate a temporary class (result=1). CS0266无法生成临时类(结果=1)。 CS0266
【发布时间】:2009-09-25 13:11:00
【问题描述】:

我只在一台测试服务器上收到此错误,但代码在其他服务器以及我的开发机器上都有效。

    Unable to generate a temporary class (result=1).
    error CS0266: Cannot implicitly convert type 'xxx.xxx.xxx.xxx.MessageHeaderMessageId?'
 to 'xxx.xxx.xxx.xxx.MessageHeaderxxxCode?'. 
An explicit conversion exists (are you missing a cast?)

这是 MessageID 的 wsdl 示例。

<xsd:element name="MessageId" nillable="true">
  <xsd:simpleType>
    <xsd:restriction>
      <xsd:simpleType>
        <xsd:restriction base="xsd:string">
          <xsd:whiteSpace value="preserve"/>
        </xsd:restriction>
      </xsd:simpleType>
      <xsd:enumeration value="xxx"/>
      <xsd:enumeration value="yyy"/>
      <xsd:length value="8"/>
    </xsd:restriction>
  </xsd:simpleType>
</xsd:element>

【问题讨论】:

  • 对不起,这是我第一次发帖。这是 WSDL 信息

标签: wcf serialization wsdl


【解决方案1】:

【讨论】:

  • 感谢 simon...我们检查了该目录的所有权限,它们看起来不错。我认为它与 WSDL 中的枚举有关,但由于某种原因,它只在该服务器上。
【解决方案2】:

发现问题。该服务器没有 .Net Framework 3.5 Service Pack 1,因此我们安装了它并开始工作。再次感谢 Simon 的回复。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-06
    • 2016-04-21
    • 1970-01-01
    • 1970-01-01
    • 2011-11-26
    相关资源
    最近更新 更多