开发者

Can't access Visual Studio project from IP, only http://localhost

开发者 https://www.devze.com 2023-03-02 22:11 出处:网络
I\'m running a project i开发者_如何学JAVAn visual studio.I hit run and it launches IE pointing at http://localhost:1267

I'm running a project i开发者_如何学JAVAn visual studio. I hit run and it launches IE pointing at http://localhost:1267

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.

The machine is actually a VM running in parallels.

Any ideas what's may be going on?


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.

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


CygWin Solution (no proxy install needed)

ssh USER@OTHER_HOST -R IIS_PORT:localhost:IIS_PORT

replace USER, OTHER_HOST and IIS_PORT. Now you can browse with your OTHER_HOST to the testpage on localhost:IIS_PORT. This enables you the ability to test your stuff on remote Linux hosts (for example).


For IIS Express, you need to grant yourself permission to bind to network adapters other than localhost, and configure IIS express to bind to all adapters. If you desire access from another computer, you need to also open the port on your firewall. This answer details these steps.


To do this you need to edit applicationhost.config file manually

<bindings>
   <binding protocol="http" bindingInformation="*:57177:localhost" />
   <binding protocol="http" bindingInformation="*:57177:127.0.0.1" />
</bindings>

Aplication will be accessible on:

localhost:57177
127.0.0.1:57177

If you want remote access, I think adding your IP address and disabling firewall will do it.


Try Changing the IIS server to Local Right Click Web Project - Properties - Web - Select Local IIS

0

精彩评论

暂无评论...
验证码 换一张
取 消