WCF错误"无法找到与绑定NetTcpBinding"的端点匹配scheme net.tcp的基址。

时间:2017-03-21 13:47:30

标签: c# wcf windows-server-2012-r2 net.tcp

我试图在Windows Server 2012 R2上运行网络服务,但是我收到以下错误

  

无法找到与绑定NetTcpBinding的端点匹配scheme net.tcp的基址。注册的基地址方案是[http]。

到目前为止我尝试过的解决方案:

我的web.config文件

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.serviceModel>
    <bindings>
      <netTcpBinding>
        <binding name="Binding1" >
          <security mode="Message">
            <message clientCredentialType="Certificate"/>
          </security>
        </binding>
      </netTcpBinding>
    </bindings>
    <services>
      <service name="ServerName" behaviorConfiguration="ServerInternet" >
        <endpoint address=""
            binding="netTcpBinding"
            bindingConfiguration="Binding1"
            contract="Namespace.Interface"
            bindingNamespace="http://www.mycompany.com/webservices"
        />

        <host>
          <baseAddresses>
            <add baseAddress="net.tcp://localhost:8080/WebService/" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ServerInternet">
          <!-- certificate infos here -->
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>

高级设置

Advanced settings, net.tcp is enabled

我已在服务器上安装的功能

Functionalities

游泳池设置

  • 经典管道
  • CLR .NET 4.0
  • LocalService Identity

网站绑定

enter image description here

出现此错误的原因是什么?

1 个答案:

答案 0 :(得分:2)

问题是您没有在服务器管理器中启用TCP激活和TCP端口共享,这不会加起来,因为这是IIS中net.tcp所必需的。