简体   繁体   中英

Unable to connect to Web Developers built in web server

When I yesterday returned to Visual Web Developer I was no longer able to run/debug my projects. Clicking the green play button launches ASP.NET Development Server (and it shows up in the systray) but the browser only shows the error message "Firefox is not able to connect to localhost:58127" (translated from Swedish). IE7 says "Cannot show web page".

I cannot figure out why this happens. It worked a couple of weeks back. Could there be a Windows setting that mess things up? (I've tried to disable the firewall without any change.)

Are you using Vista? I've had the same issues with recent Vista updates.

Firstly, make sure Visual Studio is running "As Administrator".

Secondly, when the browser launches, replace " http://localhost :" with " http://127.0.0.1 :". If that works, then its because a Windows Update messed up your hosts file.

If this is the case, make sure you hosts file has this line in it, uncommented: "127.0.0.1 localhost"

my hosts file is in this directory: "C:\\Windows\\System32\\drivers\\etc"

yours will be something similar to that.

您是否正在使用NOD32或任何其他可能引起问题的防病毒软件

I had this problem with Visual Studio 2013 . I have set the Firewall system manually. This means that, at the time of communication by programs Firewall notify me. Incorrectly linked to "devenv.exe" was blocked by the Firewall. Correct mode of communication "devenv.exe" will solve the problem. in your case cheeck Firewall options and filtered communications.

I encountered this issue today and just wanted to elaborate because my hosts file had "127.0.0.1 localhost" already defined.

I was able to see the default IIS site by referencing localhost but when I tried debugging in my IDE it would always display "cannot display webpage" in IE and "Oops! Google Chrome cannot connect to localhost" in Chrome.

I opened a command prompt and typed "netstat -a" and reviewed the results. I saw that my port used by my debugging web server was listed as "LISTENING" on the local address of [::1] only:

TCP [::1]:64212 [ComputerName]:0 LISTENING

What's unusual to me is that debugging worked for a period of time and then it seemed like all of a sudden it stopped. The first couple times it happened I re-installed Visual Web Developer Express 2010. This became rather annoying because it was a long process and the problem continued to resurface after what seemed to be an arbitrary period of time.

This latest time I changed my hosts file to include "::1 localhost" (the opposite of this solution and numerous others I found online) and that has resolved my issues with my debugging environment.

I'm grateful this resolved my issue but am still curious as to why and how my debugging environment seems to change. Additionally, I'm curious why there are multiple loopback addresses other than 127.0.0.1. Is "::1" an ip6 standard? If so, shouldn't localhost be routing to 127.0.0.1 and interpreted by the tcp/ip stack as the same as ::1?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM