【问题标题】:WCF error "Could not find a base address that matches scheme net.tcp for the endpoint with binding NetTcpBinding"WCF 错误“找不到与具有绑定 NetTcpBinding 的端点的方案 net.tcp 匹配的基地址”
【发布时间】:2017-08-13 05:33:35
【问题描述】:

我正在尝试在 Windows Server 2012 R2 上运行 Web 服务,但出现以下错误

找不到与具有绑定 NetTcpBinding 的端点的方案 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>

高级设置

我在服务器上安装的功能

池设置

  • 经典流水线
  • CLR .NET 4.0
  • 本地服务标识

网站绑定

这个错误的原因可能是什么?

【问题讨论】:

  • @jstreet 我添加了一个屏幕截图,我在端口 8080 上有 net.tcpnet.pipehttp
  • @jstreet 我把它改成了808:*,重启了服务器,但还是出现同样的错误
  • @jstreet 谢谢,我明天试试,我会通知你的
  • 您似乎没有在服务器管理器中启用 TCP 激活和 TCP 端口共享,这并没有加起来,因为这是 IIS 中的 net.tcp 所必需的...
  • 谢谢@tomasr,这就是问题所在,你能发表你的评论作为答案吗? (能够将此帖子标记为已解决)

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


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2020-06-02
    • 1970-01-01
    • 2015-07-21
    • 1970-01-01
    • 1970-01-01
    • 2010-12-20
    • 1970-01-01
    • 2023-03-31
    • 1970-01-01
    相关资源
    最近更新 更多