07 Oct 2010
There is a known bug for this 601047 This is resolved with RTM!
You can hear Eric Lawrence talk about this bug in the Herding Code Podcast

Internet Explorer 9 works great, except when it doesn’t, and it seems to not work for developers more than most, or maybe it’s just me (could the IE9 team be targeting me?).

Paranoia aside, there is an issue where when testing web applications (ASP.NET, MVC) or Silverlight applications from Visual Studio (i.e. press F5) it just refuses to load. Thankfully this has been confirmed by other people Winking smile

image

What is going on and how do we solve this? Because it is really frustrating and it also makes for bad demos (especially with TechEd around the corner).

The first part of the problem is the ASP.NET Development Server which is what is hosting your websites when you hit F5.

image

Next part of the problem is Windows, especially since it assumes IPv6 is better than IPv4. Note in the picture below that when you ping localhost you get an IPv6 address.

image

So what appears to be happening is when IE9 tries to go to localhost it uses IPv6, and the ASP.NET Development Server is IPv4 only and so nothing loads and we get the error.

To solve this fire up notepad in administrator mode and navigate to <windows directory>\system32\drivers\etc\ and open the hosts file. Inside you will find a number of lines prefixed with a hash (which makes those lines comments). Remove the hash from the line which has 127.0.0.1 in it, as below and save.

image 

This will cause Windows to resolve localhost to IPv4 first (you can confirm by pinging localhost) which means that IE9 will do the same and now it just works every time.

image

Comments

 Twitter Trackbacks for Internet Explorer 9 breaks with loca's picture

[...] Internet Explorer 9 breaks with localhost | SADev sadev.co.za/content/internet-explorer-9-breaks-localhost – view page – cached Internet Explorer 9 works great, except when it doesn’t, and it seems to not work for developers more than most, or maybe it’s just me (could the IE9 team be targeting me?). Paranoia aside, there is an issue where when testing web applications (ASP.NET, MVC) or Silverlight applications from Visual Studio (i.e. press F5) it just refuses to load. Thankfully this has been confirmed by other... Read moreInternet Explorer 9 works great, except when it doesn’t, and it seems to not work for developers more than most, or maybe it’s just me (could the IE9 team be targeting me?). Paranoia aside, there is an issue where when testing web applications (ASP.NET, MVC) or Silverlight applications from Visual Studio (i.e. press F5) it just refuses to load. Thankfully this has been confirmed by other people What is going on and how do we solve this? Because it is really frustrating and it also makes for bad demos (especially with TechEd around the corner). The first part of the problem is the ASP.NET Development Server which is what is hosting your websites when you hit F5. Next part of the problem is Windows, especially since it assumes IPv6 is better than IPv4. Note in the picture below that when you ping localhost you get an IPv6 address. So what appears to be happening is when IE9 tries to go to localhost it uses IPv6, and the ASP.NET Development Server is IPv4 only and so nothing loads and we get the error. To solve this fire up notepad in administrator mode and navigate to \system32\drivers\etc\ and open the hosts file. Inside you will find a number of lines prefixed with a hash (which makes those lines comments). Remove the hash from the line which has 127.0.0.1 in it, as below and save.   This will cause Windows to resolve localhost to IPv4 first (you can confirm by pinging localhost) which means that IE9 will do the same and now it just works every time. , Internet Explorer 9 breaks with localhost View page Tweets about this link [...]
Brad Pease's picture

Fantastic, this was driving me crazy because I had no idea what was going on but your solution seems to have worked. Thanks!
Eric Lawrence's picture

Thanks for a great bug report. The root cause and solution for this problem is known and tracked internally, and the workaround you've provided is a fine one. Thanks!
 IE9 RC Minor Changes List - MSDN Blogs's picture

[...] on the Visual Studio Test Server (e.g. by hitting F5 in an ASP.NET web project) no longer shows Page Cannot Be Displayed errors (Connect [...]
IE9 RC fixed the “Internet Explorer cannot display the webpa's picture

[...] Robert MacLean gives some more information as what was going wrong: [...]
IE9 RC fixed the “Internet Explorer cannot display the webpa's picture

[...] Robert MacLean gives some more information as what was going wrong: [...]
Internet Explorer 9 not working for localhost &amp;amp;laquo; Jo's picture

[...] http://www.sadev.co.za/content/internet-explorer-9-breaks-localhost [...]

Add new comment

dontclickme