【问题标题】:'Could not load file or assembly' error while adding WCF service reference to client将 WCF 服务引用添加到客户端时出现“无法加载文件或程序集”错误
【发布时间】:2014-03-02 12:39:54
【问题描述】:

我正在尝试通过添加使用 net.tcp 绑定的 WCF 服务的服务引用来创建 WCF 服务客户端。但我收到以下错误:

无法加载文件或程序集“CoreService-PP-DELL”或一个 其依赖项。定位程序集的清单定义 与程序集引用不匹配。

以下是我的 WCF 服务器配置:

<system.serviceModel>
<services>
<service name="CoreService.Service1" behaviorConfiguration="beh1">
  <host>
    <baseAddresses>
      <add baseAddress="net.tcp://localhost:2205/Service1.svc"/>
    </baseAddresses>
  </host>
        <endpoint
     binding="netTcpBinding"
     bindingConfiguration="ultra"
     contract="CoreService.IAccountService"/>
       <endpoint
     binding="netTcpBinding"
     bindingConfiguration="ultra"
     contract="CoreService.ICategoryService"/>
         <endpoint
     binding="netTcpBinding"
     bindingConfiguration="ultra"
     contract="CoreService.ICommonService"/>
         <endpoint
     binding="netTcpBinding"
     bindingConfiguration="ultra"
     contract="CoreService.IFollowerService"/>
         <endpoint
     binding="netTcpBinding"
     bindingConfiguration="ultra"
     contract="CoreService.IInterestService"/>
<endpoint
     binding="netTcpBinding"
     bindingConfiguration="ultra"
     contract="CoreService.IInviteService"/>

  <endpoint
          address="mex"
          binding="mexTcpBinding"
          contract="IMetadataExchange"/>
</service>
</services>
<bindings>
<netTcpBinding>
<binding name="ultra"
     maxBufferPoolSize="2147483647"
     maxBufferSize="2147483647"
     maxConnections="2147483647"
     maxReceivedMessageSize="2147483647"
     portSharingEnabled="false"
     transactionFlow="false"
     listenBacklog="2147483647"
     sendTimeout="00:01:00">
<security mode="None">
<message clientCredentialType="None"/>
<transport protectionLevel="None" clientCredentialType="None"/>
</security>
<reliableSession enabled="false"/>
</binding>
</netTcpBinding>
</bindings>
<behaviors>
    <serviceBehaviors>
      <behavior name="beh1">
        <serviceMetadata httpGetEnabled="true" />
        <serviceDebug includeExceptionDetailInFaults="True" />
        <dataContractSerializer maxItemsInObjectGraph="65536" />
      </behavior>
    </serviceBehaviors>
  </behaviors>
</system.serviceModel>

【问题讨论】:

  • 这与 WCF 无关。在此站点中搜索您得到的错误:“找到的程序集的清单定义与程序集引用不匹配”.
  • @CodeCaster 实际上它无法找到此 WCF 服务的程序集。我重建了它,但它不起作用。
  • 无论程序集中有什么,程序集清单都不匹配。
  • 感谢@CodeCaster 我解决了。我从 build 文件夹中删除了所有内容并重建了它。但我面临另一个问题。这是问题的链接:stackoverflow.com/questions/22146035/…

标签: c# asp.net .net web-services wcf


【解决方案1】:

您可以尝试 Fusion 日志查看器 - http://msdn.microsoft.com/en-us/library/vstudio/e74a18c4(v=vs.100).aspx

发现丢失的 CoreService-PP-DELL 依赖项(程序集)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-03-25
    • 2015-04-30
    • 1970-01-01
    • 2011-08-12
    • 2012-05-20
    • 1970-01-01
    • 2014-04-04
    相关资源
    最近更新 更多