You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

IIS托管WCF服务net.tcp协议无法通信问题排查求助

IIS托管WCF服务net.tcp绑定错误解决方案
  • 检查站点与应用程序的net.tcp协议启用配置

    • 确认站点的net.tcp绑定格式为net.tcp://*:808/(需包含末尾斜杠),仅填写端口会导致路径匹配失败。
    • 进入对应应用程序的「高级设置」,确认「启用的协议」字段包含net.tcp(格式示例:http,net.tcp,逗号分隔无空格)。
  • 验证WCF服务配置文件正确性

    • 检查服务端点配置,确保绑定类型为netTcpBinding,若使用端口共享服务,需将portSharingEnabled设为true。示例配置片段:
      <system.serviceModel>
        <services>
          <service name="YourNamespace.ServiceName">
            <endpoint address="" binding="netTcpBinding" bindingConfiguration="NetTcpBindingConfig" contract="YourNamespace.IServiceName"/>
          </service>
        </services>
        <bindings>
          <netTcpBinding>
            <binding name="NetTcpBindingConfig" portSharingEnabled="true">
              <security mode="Transport">
                <transport clientCredentialType="Windows"/>
              </security>
            </binding>
          </netTcpBinding>
        </bindings>
      </system.serviceModel>
      
    • 确认服务baseAddress包含net.tcp地址,或端点使用相对地址时站点绑定已覆盖对应路径。
  • 检查应用程序池兼容性

    • 确认应用程序池「高级设置」中「启用32位应用程序」选项与服务编译平台匹配(64位服务设为False,32位服务设为True)。
    • 验证应用程序池的.NET CLR版本与WCF服务目标框架版本兼容。
  • 排查网络与防火墙限制

    • 确认Windows防火墙或第三方防火墙允许net.tcp协议通过,而非仅开放808端口的TCP流量,可临时关闭防火墙测试。
    • 检查是否有组策略限制net.tcp端口的使用权限。
  • 查看日志定位具体原因

    • 打开Windows事件查看器的「应用程序」日志,查找WCF相关错误事件,获取更详细的失败细节。
    • 查看IIS站点日志,确认net.tcp请求是否到达服务器及对应的错误代码。
  • 重置相关服务

    • 执行命令 iisreset 重启IIS,随后重启Net.Tcp Port Sharing Service和Net.Tcp Listener Adapter Service,确保服务状态正常。

内容的提问来源于stack exchange,提问作者aprajitapriya

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.24 03:07:04