asp.net-web-api2 - WEB API 2,Selfhost,除 "localhost"之外的所有访问都被拒绝

标签 asp.net-web-api2 owin self-hosting

在WEB API 2 OWIN自托管项目中,我收到了“本地主机被拒绝”的异常,该异常是localhost以外的任何东西抛出的:

string baseUrl = http://localhost:2500;
WebApp.Start<Startup>(baseUrl);

如果我使用127.0.0.1或计算机的实际IP地址,则会收到此异常。在他们的博客中,没有人提到基于自托管Web api 2 owin的问题。

这里有什么问题,我该如何解决?

我已经找到了这个Self hosted OWIN and urlacl,但是抛出了同样的异常。

最佳答案

这对我有用

What URL does OWIN understand for ipv6 self-hosting?

WebApp.Start<Startup>("http://+:43666");

我仍然认为应该在WEB API 2 OWIN教程中提及和讨论这一点!

关于asp.net-web-api2 - WEB API 2,Selfhost,除 "localhost"之外的所有访问都被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27885836/

相关文章:

c# - 如何使用 AngularJS $http url 引用另一个项目中的 Controller ?

c# - 您可以将 UserId 存储在 Owin OAUTH 2 token 中吗?

windows - 服务无法启动 : can't load assembly

c# - 在 WebApi2 + Owin 中使用 AuthorizeAttribute 时,HEAD 请求因 System.Net.ProtocolViolationException 而失败

c# - Libsodium-net - 无法加载 DLL 'libsodium.dll

iis - 使用基于 katana-owin 的 web api 运行的 Swashbuckle 不适用于 IIS,但适用于 IIS Express

asp.net-web-api - HostingEnvironment.QueueBackgroundWorkItem 与 A​​SP.NET Web API 使用 OWIN

asp.net - 自托管 ASP.NET Web API 2 REST 服务的 token 身份验证和授权

.net - "System.MissingMemberException: The server factory could not be located"启动 Microsoft.Owin 在 TeamCity 中自托管

c# - 防止公共(public)服务过度使用