Cannot access localhost on Vista when debugging local ASP.NET Applications

by APIJunkie 6. May 2008 17:31

If you are trying to debug ASP.NET applications on Vista you might run into the following problem:

localhost is not accessible through your browser and the error that is displayed is "Internet Explorer cannot display the webpage".

After some googling I ran across a reference to the same problem.

The problem has to do with the fact that there are 2 entries for local host in the hosts file ([Windows directory]\System32\drivers\etc\hosts).

One for ipv4 and one for ipv6.

Example: localhost
::1 localhost

To solve the problem you can remark one of them. The example below remarks the ipv6 entry. localhost
# Causes problems when using localhost ->
#::1 localhost

Note that you might not be able to modify the hosts file even if you are running as an administrator.

The following Microsoft KB explains how to change the hosts file:;en-us;923947

Hope this helps...


ASP.NET | PRB | Vista | How To | Debug


5/6/2008 7:32:56 PM #


Trackback from

Cannot access localhost on Vista when debugging local ASP.NET Applicat

10/6/2008 2:51:03 AM #

moughees baig

Thx dude, it really works with my case. I am really very thankful to you.

moughees baig

12/30/2008 2:44:32 AM #

Ricardo Ribeiro

Worked just fine!

Ricardo Ribeiro Portugal

2/15/2009 9:06:32 PM #


Solved my problem.

Thanks for posting this.


2/15/2009 9:28:29 PM #


Great stuff, It really worked, i tired it before, this also works for php.

Moughees Saudi Arabia

3/9/2009 11:14:58 AM #


Works for me.  Cheers!

Ben United States

3/9/2009 11:57:42 AM #


wow it worked for me thanks you very much....

Suman Australia

3/10/2009 4:51:12 PM #


thx's really work..thousand thx.


3/12/2009 3:37:06 AM #


Hey APIJunkie, when I remark out the ::1 localhost and I run my application I am asked for an administrator username and password when internet explorer starts up. Any idea why this would happen?

Mark Ireland

3/15/2009 10:52:30 AM #

Mike spaargaren

thank you, thank you, thank you
i was lookd for this problem over 8 hours.

now you solvd my problem.

thank you

( my problem was becaus localhost doesn't works flash player debugger also dosn't works. )

Mike spaargaren Belgium

Comments are closed

About the author

Name of author

I was first wounded by x86 assembly, recovered and moved on to C. Following a long addiction to C++ and a short stint at rehab I decided to switch to a healthier addiction so I am now happily sniffing .NET and getting hooked on Silverlight.

I am mainly here to ramble about coding, various API’s, Junkies(me especially) and everything else that happens between coders and their significant other.

  James Bacon