gpt4 book ai didi

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

转载 作者:可可西里 更新时间:2023-11-01 02:51:26 26 4
gpt4 key购买 nike

我在配置了 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com