Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.net IIS7.5上承载的WCF NetCpBinding停止工作_.net_Wcf_Iis_Net.tcp - Fatal编程技术网

.net IIS7.5上承载的WCF NetCpBinding停止工作

.net IIS7.5上承载的WCF NetCpBinding停止工作,.net,wcf,iis,net.tcp,.net,Wcf,Iis,Net.tcp,我有一个简单的.NET 4 WCF服务,我在IIS7.5上本地托管了该服务。最初,我使用httpBinding托管它,效果很好。然后我将它切换到netTcpBinding,在相应地更改web.config文件之后,它也可以正常工作。然而,今天它决定停止工作。我根本无法使用测试客户端连接到该服务,导致: URI:net。tcp://localhost/case/service.svc/mex 元数据包含无法解析的引用:'net。tcp://localhost/case/service.svc

我有一个简单的.NET 4 WCF服务,我在IIS7.5上本地托管了该服务。最初,我使用
httpBinding
托管它,效果很好。然后我将它切换到
netTcpBinding
,在相应地更改
web.config
文件之后,它也可以正常工作。然而,今天它决定停止工作。我根本无法使用测试客户端连接到该服务,导致:

URI:net。tcp://localhost/case/service.svc/mex    元数据包含无法解析的引用:'net。tcp://localhost/case/service.svc/mex'.    无法调度该消息,因为终结点地址“net”处的服务失败。tcp://localhost/case/service.svc/mex'对于地址的协议不可用。

我已检查是否(仍然)安装了非http激活服务;网络tcp侦听器服务正在运行;net.tcp位于站点启用的协议列表中;我已经运行了
servicemodelreg.exe-ia
;我还重新运行了
aspnet_regiis.exe-I
;最后,我检查了net.tcp绑定是否在站点上

如果我运行
netstat
我可以看到端口上有东西正在侦听,但我无法连接到它

这让我发疯了,因为今天早上它工作得很好(就像上周一样),而现在就不是了

编辑:如果我在IE中访问该服务,我可以看到它抛出以下异常:

Could not find a base address that matches scheme net.tcp for the endpoint with binding NetTcpBinding. Registered base address schemes are [http].
但是查看
web.config
文件,情况似乎并非如此:

<services>
  <service behaviorConfiguration="ServiceBehavior" name="[REMOVED].[REMOVED]">
    <endpoint binding="netTcpBinding" bindingConfiguration="PortSharingBinding" contract="[REMOVED].[REMOVED]" />
    <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange" />
  </service>
</services>

<bindings>
  <netTcpBinding>
    <binding name="PortSharingBinding" portSharingEnabled="true">
      <security mode="None"/>
    </binding>
    <binding name="mexTcpBinding" portSharingEnabled="true">
      <security mode="None" />
    </binding>
  </netTcpBinding>
</bindings>

是否已检查端口共享已启用

编辑-需要另一项服务:

除了
netcpportsharing
之外,还需要服务
netcpactivator


请参见

好的,终于解决了。我在站点级别启用了net.tcp协议,但在应用程序级别没有启用。我想这一定是以前的事了,我想我可能是在早些时候更改了项目名称之后创建了一个新的应用程序,显然忘记了在应用程序上设置协议-doh

因此,在IIS上托管WCF net.tcp服务的最终检查表是:

  • 确保已安装WCF非HTTP激活服务
  • 确保
    Net.Tcp侦听器
    服务和
    Net.Tcp端口共享
    服务都在运行
  • 将net.tcp添加到站点和应用程序的已启用协议中(要从IIS管理器访问“高级设置”选项,必须存在http绑定)
  • 运行
    servicemodelreg.exe-ia
    向IIS注册WCF元素
  • 运行
    aspnet\u regiis.exe-i
    以确保使用IIS正确设置.NET
  • 将net.tcp绑定添加到站点

  • 是的,已经启用并正在运行。你有可能使用WAS吗?我想是的。我已经使用net.tcp在IIS 7.5(在Win7上运行)上托管了该服务,因此我猜该服务将使用WAS。请检查我的编辑中的链接。。。它为工作设置提供了一些提示-包括一些权限/权限的东西…如果我能给你+10,我会。。。我今天读了好几个小时的东西,没有人谈论确保在这两个地方都启用协议。这个问题需要链接到所有其他net.tcp iis不工作线程中。