我正在做一个asp.net core应用程序,但我的项目从调试模式(使用f5)停止运行。我需要在本地IIS上托管它来调试代码。当在本地运行时,我得到这个错误 "Bad Request - Invalid Hostname"。
你可以尝试以下步骤来解决这个问题。
找到您正在开发的特定站点的条目(例如 "Test "在6306端口运行),例如。
<site name="test" id="1">
<application path="/" applicationPool="gratedAppPool">
<virtualDirectory path="/" physicalPath="" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:6306:localhost" />
</bindings>
</site>
替换以下 bindingInformation=":6306:localhost" with bindingInformation=":6306:*"