我开发了一个使用 WCF 服务的 C# 控制台应用程序。在本地机器上一切正常。当我创建设置文件并分发 exe 和 exe.config 文件时,应用程序在同一网络上的其他机器上出错,并出现以下错误:
通信对象 System.ServiceModel.Channels.ServiceChannel 不能用于通信,因为它处于故障状态。
WCF 服务端点 URL - http://inblrlwssc251.wdf.corp:7980/AfariaService/Server也可以从其他计算机访问。不确定会出现什么问题。
服务的配置如下所示,我使用 WSHTTP 绑定:
<system.serviceModel>
<diagnostics>
<messageLogging logEntireMessage="true" logMalformedMessages="true"
logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" />
</diagnostics>
<bindings>
<netNamedPipeBinding>
<binding name="NetNamedPipeBinding_IServerService" />
</netNamedPipeBinding>
<netTcpBinding>
<binding name="NetTcpBinding_IServerService">
<security mode="Message" />
</binding>
</netTcpBinding>
<wsHttpBinding>
<binding name="WSHttpBinding_IServerService" />
</wsHttpBinding>
</bindings>
<!--
Modify the "adress" in each of the endpoint tags based on where the Afaria API service is hosted
-->
<client>
<endpoint address="http://inblrlwssc251:7980/AfariaService/Server"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IServerService"
contract="AfariaServerService.IServerService" name="WSHttpBinding_IServerService">
</endpoint>
<endpoint address="net.tcp://inblrlwssc251:7982/AfariaService/Server"
binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IServerService"
contract="AfariaServerService.IServerService" name="NetTcpBinding_IServerService">
</endpoint>
<endpoint address="net.pipe://localhost/AfariaService/Server"
binding="netNamedPipeBinding" bindingConfiguration="NetNamedPipeBinding_IServerService"
contract="AfariaServerService.IServerService" name="NetNamedPipeBinding_IServerService">
</endpoint>
</client>
</system.serviceModel>
任何帮助或正确方向的指针将不胜感激。