1. 关闭vs2015, 【这是关键一步】, 否则可能一直会不能正常访问 Bad REquest
2. 打开项目目录下的.vs目录, 修改applicationhost.config文件中的内容
3. 找到你的项目, 增加一行
<!--找到项目名, 一定是你当前调试的项目--> <site name="muTian.sysAdmin.UI.Portal" id="2"> <application path="/" applicationPool="Clr4IntegratedAppPool"> <virtualDirectory path="/" physicalPath="D:\CsharpProject\muTian.sysAdmin\muTian.sysAdmin.UI.Portal" /> </application> <bindings> <!--这一行是默认就有的--> <binding protocol="http" bindingInformation="*:10829:localhost" /> <!--这一行是增加的--> <binding protocol="http" bindingInformation="*:10829:192.168.0.110" /> </bindings> </site>
4. 再次使用【管理员】权限打开 Vs2015, 运行, 然后看看你的IISExpress
5. 具体的web项目属性如下:
6. 如果还不行, 那肯定是你机器的防火墙, 或者内网被管理员限制了的问题, 建议调试期间先将防火墙关闭, 以防网络故障带来的不必要麻烦