【发布时间】:2017-12-22 04:02:17
【问题描述】:
我有一个 ASP .Net Core 1.1 Web API 和 Web 应用程序在我的本地主机上从 Windows 10 上的 Visual Studio 2017 运行。
当我运行项目时,API 在http://localhost:50082/api/ 上运行,而网络应用在http://localhost:60856/ 上运行
但是,如果 LAN 上的其他人尝试访问它(使用我计算机的 IP 地址 - http://192.168.1.101:60856/ 他们会得到一个
错误的请求 - 无效的主机名
错误。实际上,。我也收到此错误,因为我使用了我的 IP 地址。我在 C:\Users\Documents\IISExpress\config\applicationhost.config 文件中尝试了十几种变体,例如:
<bindings>
<binding protocol="http" bindingInformation="*:60856:localhost" />
</bindings>
和
<bindings>
<binding protocol="http" bindingInformation="*:60856:" />
</bindings>
每次都重新启动项目(以及因此 IIS Express),但似乎没有任何效果。有什么想法吗?
【问题讨论】:
-
我也关闭了防火墙,并且没有运行任何第三方杀毒软件...
标签: asp.net-core-mvc iis-express asp.net-core-1.1