Visual Studio 2005/2008 on Vista Internet Explorer cannot display the webpage

Visual Studio 2005/2008 on Vista Internet Explorer cannot display the webpage

I faced a strange problem with Visual Studio 2005 and Visual Studio 2008 which is I have several ASP.NET Projects some of them using .NET 2.0 or Visual Studio 2005 and the others are using .NET 3.5 or Visual Studio 2008.

The problem was when I try to run the Web Application I got this error:

Internet Explorer cannot display the webpage

I am not using IIS for these Web Application. I have tried the usual solutions such as Restart the Visual Studio, Restart my Laptop and Reinstall Visual Studio but nothing solve this problem. After searching for a solution for this problem I finally got the answer.

All you have to do is editing the host file located here %windir%\System32\drivers\etc\hosts
Open this file with Note Pad don’t forget to right Click and Run as administrator. Just comment the line that contains localhost as shown below:

No restart is needed, either of computer or Visual Studio.

# Copyright (c) 1993-2006 Microsoft Corp.
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one space.
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a ‘#’ symbol.
# For example:
# # source server
# # x client host
# localhost
# ::1 localhost

Share this post

Comments (2)

  • Unknown Reply

    yes I faced this problem and I searched the cause and how to fix and found that it is caused by some an update for vista ,it edits in the host file and remove the reference localhost that refers to which is … just make re-reference

    # localhost

    July 25, 2009 at 11:14 AM
  • Bassem Fawzy Reply

    I think another solution would be run Visual studio as an administrator. In start menu Right click Visual Studio and choose Run As Administrator. My personal advice man is to get rid of Vista as It has never been meant for developers and would reduce your productivity. I spent 3 months of my development life on Vista and gone with no return 😀 .

    July 30, 2009 at 3:19 PM

Leave a Reply

Your email address will not be published. Required fields are marked *