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

by APIJunkie 5/6/2008 5:31:00 PM

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:

127.0.0.1 localhost
::1 localhost

To solve the problem you can remark one of them. The example below remarks the ipv6 entry.

127.0.0.1 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:

http://support.microsoft.com/default.aspx?scid=kb;en-us;923947

Hope this helps...
 

Currently rated 5.0 by 3 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

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

Comments

5/6/2008 7:32:56 PM

trackback

Trackback from DotNetKicks.com

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

DotNetKicks.com

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 pt

2/15/2009 9:06:32 PM

Ioannis

Solved my problem.

Thanks for posting this.

Ioannis

2/15/2009 9:28:29 PM

Moughees

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

Moughees sa

3/9/2009 11:14:58 AM

Ben

Works for me. Cheers!

Ben us

3/9/2009 11:57:42 AM

Suman

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

Suman au

3/10/2009 4:51:12 PM

coder

thx bro..it's really work..thousand thx.

coder

3/12/2009 3:37:06 AM

Mark

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

Mark ie

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 be

Add comment


(Will show your Gravatar icon)  

  Country flag





Live preview

7/3/2009 3:23:10 PM

Powered by BlogEngine.NET 1.2.0.0
Theme by Mads Kristensen

About the author

Name of author

My name is Bacon…James Bacon.

I am an API wars veteran I was 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.

E-mail me Send mail


Calendar

<<  July 2009  >>
MoTuWeThFrSaSu
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

View posts in large calendar

Recent comments

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2009

Sign in