Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ASP.NET 3.5 wasn't rendering web pages in VS 2008
Message
General information
Forum:
ASP.NET
Category:
Other
Title:
ASP.NET 3.5 wasn't rendering web pages in VS 2008
Environment versions
Environment:
ASP.NET
OS:
Vista
Application:
Web
Miscellaneous
Thread ID:
01434342
Message ID:
01434342
Views:
130
I could not get Visual Studio 2008's ASP.NET web service to render my web pages. So, I kept looking into this and finally solved the issue a few minutes ago; it is past midnight here in California. I am posting this on UT, just in case anyone else has the same problem and goes in the same circles I've been traveling in. This happened on both my desktop and my laptop. I think it is a VISTA problem. Here is what I found:

The "Hosts" file in "C:\Windows\System32\drivers\etc" had an error in it that somehow got put in, perhaps during some installation, but who knows how it got there; it just did and it has stopped me from progressing with learning ASP.NET 3.5. I commented out only one line in the HOSTS file. There were two lines that were opposing each other, as follows:
::127.0.0.1       localhost
::1         localhost
I ended up commenting out the 2nd line, "::1 locahost". I used the "#" sign to comment out the 2nd line, closed the HOSTS file, restarted VS 2008, opened my ASP.NET VB website, hit the green Start Debugging (F5), and the page rendered perfectly. No more goign in circles, no more cursing at the computer (I didn't do this too much, but felt very frustrated frankly). I will also post what I found by googling the ASP.NET problem. I thank Preston Birdwell for the solution to this problem. STUFF HAPPENS, RIGHT?

---

http://forums.asp.net/t/1437368.aspx
Dave,
You don't mention your OS. If it is Vista, an automatic update or certain virus protection apps may have made a change to your 'hosts' file.

Your "hosts" file is what tells your computer that "localhost" should map to "127.0.0.1" so here is where your file is:
C:\WINDOWS\system32\drivers\etc\hosts
Close Visual Web Developer and any browser that open.

Locate the 'hosts' file using Windows Explorer

Open that file in Notepad under a 'computer administrator account'. The following entry should be present. If it is not, or does not look like the following, add or edit the entry:
127.0.0.1 localhost

Save the file and reboot your machine.

Try to open the page(s) that were giving you the 404 error.
-Preston
Preston Birdwell
Columbia, CA USA

Thanks Preston.
The hosts file had an entry:
::1 localhost
I made the change you suggested and the built in server is now able load my applications in IE. Reboot was not needed. By the way, I'm running Vista Home.
Dave K.
Next
Reply
Map
View

Click here to load this message in the networking platform