使用netsh命令导致VS调试无法连接配置服务器

使用netsh命令导致VS调试无法连接配置服务器

 

个人分类: C#

版权声明: https://blog.csdn.net/langyuewu/article/details/39709889

在VS调试站点,默认使用IISExpress,locall+端口,为了使用IP地址、多域名调试,找到



IISExpress下的applicationhost.config,在目标站点下增加类似行:

 <binding protocol="http" bindingInformation="*:51000:192.168.1.10" />

变成

 
  1. <binding protocol="http" bindingInformation="*:51000:localhost" />

  2. <binding protocol="http" bindingInformation="*:51000:192.168.1.10" />


通过IP地址访问时可能出现400错误,管理员权限打开CMD,输入:

 

netsh http add urlacl url=http://192.168.1.10:51000/ user=everyone

本来好好的,结果手贱,又输入一个:

netsh http add urlacl url=http://127.0.0.1:51000/ user=everyone

由于一直用192那个调试,没发现问题,后来发现VS不能调试了,提示无法连接配置服务器,打开其它项目却能调试,怀疑到端口占用,然后寻到上述命令,输入下面两句,均报错误:

netsh http delete urlacl url=http://127.0.0.1:51000/ user=everyone

netsh http delete urlacl url=http://127.0.0.1:51000

上网搜,都没有找到相应方法,突然尝试打入:

netsh http delete urlacl url=http://127.0.0.1:51000/

顺利执行,打开VS调试,回复正常,唉,原来少打了个“/”

 

原文链接:https://blog.csdn.net/langyuewu/article/details/39709889

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值