VS本地调试 HTTP Error 400. The request hostname is invalid

操作系统环境:

  windows 10 专业版

编译环境:

       vs2017

在applicationhost.config文件中增加了本机ip地址想和前端联调

<bindings>
    <binding protocol="http" bindingInformation="*:7001:localhost" />
    <binding protocol="http" bindingInformation="*:7001:192.168.1.150" />
</bindings>

 

改好之后运行网站  localhost:7001  可以访问   输入192.168.1.150:7001就提示 HTTP Error 400. The request hostname is invalid

修改的方式为:vs2017用管理员方式打开,然后再打开项目运行,就能正常访问了

 

参考自:https://www.bbsmax.com/A/D854jnE2zE/

posted @ 2021-04-30 16:06  狼窝窝  阅读(2399)  评论(0)    收藏  举报