问题描述
我有一个 ASP.NET Core 应用程序在 IIS 上流畅运行,但在运行 EXE 时突然开始抛出以下错误。
[23:14:04 FTL] Unable to start Kestrel.
System.Net.sockets.socketException (10013): An attempt was made to access a socket in a way forbidden by its access permissions.
at System.Net.sockets.socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error,String callerName)
at System.Net.sockets.socket.dobind(EndPoint endPointSnapshot,SocketAddress socketAddress)
at System.Net.sockets.socket.Bind(EndPoint localEP)
at Microsoft.AspNetCore.Server.Kestrel.Transport.sockets.socketConnectionListener.Bind()
at Microsoft.AspNetCore.Server.Kestrel.Transport.sockets.socketTransportFactory.BindAsync(EndPoint endpoint,CancellationToken cancellationToken)
at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.<>c__displayClass21_0`1.<<StartAsync>g__OnBind|0>d.MoveNext()
--- End of stack trace from prevIoUs location where exception was thrown ---
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindEndpointAsync(Listenoptions endpoint,AddressBindContext context)
at Microsoft.AspNetCore.Server.Kestrel.Core.Listenoptions.BindAsync(AddressBindContext context)
at Microsoft.AspNetCore.Server.Kestrel.Core.AnyIPListenoptions.BindAsync(AddressBindContext context)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.Addressesstrategy.BindAsync(AddressBindContext context)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindAsync(IServerAddressesFeature addresses,KestrelServerOptions serverOptions,ILogger logger,Func`2 createBinding)
at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.StartAsync[TContext](IHttpApplication`1 application,CancellationToken cancellationToken)
[23:14:04 FTL] Api host terminated unexpectedly
我可以看到此应用使用的端口位于 Protocol tcp Port Exclusion Ranges
。我也尝试过更改端口,但是一旦更改端口,新端口也会添加到此 Protocol tcp Port Exclusion Ranges
列表中。
我已尝试以下步骤来解决此问题:
我不确定是不是因为最新的 Windows 安全更新?
有人知道如何解决这个问题吗?
谢谢, 阿布舍克
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)