win10 visual studio IIS Express 局域网调试,默认只能localhost
Posted liangouyang
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了win10 visual studio IIS Express 局域网调试,默认只能localhost相关的知识,希望对你有一定的参考价值。
vs2015自带IISExpress默认只能localhost,这样根本无法跨局域网调试啊
win10/win7下vs2015自带IISExpress支持局域网访问
找到工程目录下的配置文件,E:\projects\visual studio2015\XXprojectname\.vs\config
用记事本打开applicationhost.config文件,找到:
<bindings>
<binding protocol="http" bindingInformation="*:58975:localhost" />
</bindings>
在binding下边添加一行,如:
<bindings>
<binding protocol="http" bindingInformation="*:58975:localhost" /> (不能删)
<binding protocol="http" bindingInformation="*:58975:192.168.0.172" /><!-- 加入此行 -->
</bindings>
添加完后保存,然后重启iisexpress,按照上述步骤,在win7操作系统下已经可以正常访问,但是经测试win10下居然没有反应,需要运行下边的语句:
打开运行窗口,输入CMD,enter,然后执行下边的命令即可。 (管理员身份打开)
netsh http add urlacl url=http://192.168.0.172:58975/ user=everyone
点击调试就可以看到localhost与192.168.0.172都打开了服务。
以上是关于win10 visual studio IIS Express 局域网调试,默认只能localhost的主要内容,如果未能解决你的问题,请参考以下文章