c# - WCF - 无法停止 net.tcp 绑定(bind)(托管在 IIS 上)

标签 c# wcf iis tcp

我在配置了 net.tcp 端点的 IIS 上运行 WCF 服务。在 IIS 上禁用页面后,我仍然能够对我的服务 o.O 运行请求。 禁用应用程序池按预期工作(服务不再可用)。

<system.serviceModel>
    <services>
      <service name="xyz.Service.Authentication.Implementation.AuthenticationService">
        <endpoint binding="netTcpBinding"
                  bindingConfiguration="NetTcpBinding"
                  contract="xyz.Service.Authentication.Model.IAuthenticationService"/>
      </service>
    </services>
    <bindings>
      <netTcpBinding>
        <binding name="NetTcpBinding" sendTimeout="00:00:30" 
                 transactionFlow="false" 
                 portSharingEnabled="false"
                 maxReceivedMessageSize="18000">
          <security mode="Transport">
            <transport clientCredentialType="Windows" protectionLevel="Sign"/>
          </security>
        </binding>
      </netTcpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <serviceAuthorization principalPermissionMode="UseWindowsGroups"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

这是错误还是功能?

最佳答案

我遇到了类似的问题,我发现:

  • 停止网站不会停止 net.tcp 服务
  • Disable App Pool 会禁用服务但不会释放端口,SMSvcHost.exe 仍使用该端口
  • 之后重新启动也无济于事。

释放端口(被其他东西使用)的唯一方法是在 IIS 中删除 net.tcp 绑定(bind)

我花时间在这上面,因为从 net.tcp 服务收到了错误的答案。我花了一段时间才发现——这不是我的服务,而是老残疾人的服务。这可以为其他人节省时间。

Delete net.tcp binding

关于c# - WCF - 无法停止 net.tcp 绑定(bind)(托管在 IIS 上),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34339364/

相关文章:

c# - 将鼠标悬停在条形图上时使用 ASP.NET MVC 3.0 显示列标签

c# - 自处理事件是否会阻止实例被垃圾收集?

c# - 需要一个包含除排除单词之外的任何字符的 C# 正则表达式模式

c# - 通过 SSL 问题的 Silverlight 3/WCF 通信

由于 SSL,WCF 服务无法在 Visual Studio 中运行

c# - 如何绕过或实现 IComparable

WCF HTTPS OpenSSL 无法连接写入 :errno=54

c# - 在 ASP.NET 中使用 Windows 身份验证

web-services - 为 IIS 应用程序池帐户安装客户端证书

node.js - 即使所有资源均可访问,Node.js Web 服务器日志中也会出现 "IIS Detailed Error - 404.0"