无法通过IP只能从http://localhost访问Visual Studio项目 [英] Can't access Visual Studio project from IP, only http://localhost

查看:184
本文介绍了无法通过IP只能从http://localhost访问Visual Studio项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Visual Studio中运行一个项目.我点击运行,它启动指向http://localhost:1267

I'm running a project in visual studio. I hit run and it launches IE pointing at http://localhost:1267

如果我尝试访问http://10.211.55.3:1267(机器的IP),即使从同一台机器进行访问,我也一无所获. IIS7可以正常工作.

If I try to visit http://10.211.55.3:1267 (the machine's IP), I get nothing, even when visiting from the same machine. IIS7 works fine.

该计算机实际上是并行运行的VM.

The machine is actually a VM running in parallels.

有什么想法吗?

推荐答案

如果使用的是Visual Studio开发服务器(而不是IIS),则服务器将仅绑定到本地主机.您不能使用其他IP地址访问它.如果需要,您可以使用代理解决此问题.

If you are using the Visual Studio Development Server (and not IIS,) your server will only bind to localhost. You can not use another IP address to access it. If you must, you can work around this with proxies.

如果您正在运行IIS,请确保您的Web服务器已绑定到所有地址(0.0.0.0)

If you are running IIS, make sure that your web server is binding to all addresses (0.0.0.0)

这篇关于无法通过IP只能从http://localhost访问Visual Studio项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆