I guess I was bored last night so I decided to upgrade my development system to Vista. I have been running Windows XP Pro without any real issues but I wanted to start using some of the features of Vista I had only used in my virtual machines.
The upgrade went pretty well with only a handful of driver issues for video, printer and my sound card.
I installed the Visual Studio 2005 updates to run on Vista outlined by Microsoft and Visual Studio seemed to run just fine. Note that ASP.NET is not installed by default, so you will need to enable it.
I normally use the ASP.NET Development Server for ASP.NET applications for development and testing and move over to IIS for deployment. The only real problem I faced was hitting Ctrl-F5 in Visual Studio 2005 to run one of my web applications, the server started, Internet Explorer opened but nothing happened. I waited for several minutes, but nothing.
After searching the web many different ways I found out that Vista implements IPv6 (versus the old IPv4) and browsers may have issues resolving http://localhost. Since I use both Internet Explorer and Firefox for web development I decided to try just copying the URL the ASP.NET Development Server was using and pasting manually into both browsers and the same result…nothing, no error, nothing.
It turns out others have had this same problem and you can turn off IPv6 in Firefox pretty easily.
Disable IPv6 in Firefox
- Type about:config in the address bar and press Enter.
- Scroll down until you find network.dns.disableIPv6.
- Double-click on it to change its value to true.
- Restart Firefox.
After restarting Firefox I pasted the address used by ASP.NET Development Server into the Firefox address bar….and it worked like a charm. So, it seems IPv6 is the issue.
I spent an hour or so trying to find a similar configuration for Internet Explorer but had no luck. If a reader finds a setting in IE to disable IPv6 I would like to hear about it so I can update this post.
The solution I did get to work in IE was to disable IPv6 for my system. I found a great article by the Cable Guy which pointed out what to do. In short I set the following key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\tcpip6\Parameters\DisabledComponents
to a value of 0xff and restarted the system. Checking the ASP.NET Development Server URL in the IE address bar displayed my page.
Conclusion
This worked for me but I have reservations about the solution. What are the side-effects or the future effects of disabling IPv6 which Microsoft includes with Vista. If the system evolves and I need IPv6 then I will have a different problem.
If someone has a different solution I would like to hear it. I am not keen on disabling IPv6 but it works and it is not irreversible. On the plus side, browsing the web seems to be faster.
19 responses so far ↓
Charles Assaf // January 8, 2008 at 11:09 pm |
Found a more elegant solution for you (don’t kick yourself too hard).
Disable IPv6 in your network adapter’s properties (you likely wont need it for a couple of years yet, and M$FT should have figured it out by then).
This works for both IE and Firefox (without changing Firefox’s config).
Rob Bazinet // January 8, 2008 at 11:11 pm |
@Charles I tried this and it did not work, I had to do what I documented in my post. I found out disabling IPv6 on the network adapter did not disable for loopback.
Thanks.
Saeed Tabrizi // January 19, 2008 at 10:01 am |
Hi
I have same problem too in vs2008 on vista .
I configured my firefox as you say , its working good
But my system , still not working by localhost .
if you find any solution , please tell to me by my email.
Rob Bazinet // January 19, 2008 at 12:19 pm |
@Saeed This post IS a solution. If you follow it, it works on Vista.
portella // February 6, 2008 at 3:23 pm |
wow … Thanks a lot Rob! This was happing to me also … I tried to disable IPv6 in network adapter’s properties as Charles suggested without success …
Thanks!
Rob Bazinet // February 6, 2008 at 3:36 pm |
@Portella Great, glad I could help. It just shows Vista is in need of a service pack or two.
marko // February 9, 2008 at 3:54 pm |
what about windows xp pro, i have wrong ports in IE and in ASP.NET development server when i load local webpage..
Visual studio 2008 pro..
Rob Bazinet // February 10, 2008 at 8:35 pm |
@Marko Not sure about XP Pro, I have never see issues with VS 2008 and XP Pro.
Manni // February 15, 2008 at 5:38 am |
Wow. Interesting.
I’d be curious to see what Vista’s hosts file looks like, though. There should be some IP attached to localhost in there.
Saad Siddique // February 29, 2008 at 10:22 am |
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\tcpip6\Parameters\DisabledComponents
i did not find the Disables Components in my Parameters. I’m still unable to solve my problem in IE, however, it’s working fine in FireFox now
nats // March 3, 2008 at 1:52 pm |
HI!
I have Vista Home Premium too. I still could not make the VSW 2008 work. I have the same problem as Siddique. I don’t see any DisabledComponents in my Registry.
Do u know why?
Thanks
michal // March 6, 2008 at 1:44 pm |
on my vista and vs2008 i only have to change in IE from http://localhost:portnum/SomePage.aspx to http://127.0.0.1:portnum/SomePage.aspx and everything works
Peter Bucher : Kein Zugriff auf Webseite mit IE und Vista / WS08 // March 11, 2008 at 5:32 pm |
[...] Ein Leidensgenosse [...]
michal // March 15, 2008 at 3:09 pm |
I found even better way, just comment int system32/drivers/etc/ line containing “[:::1] localhost”
Rob Bazinet // March 15, 2008 at 5:39 pm |
@Michal Great info, I will give it a try on my next Vista install.
Sabith // March 23, 2008 at 8:25 am |
thanx Rob Bazinet and michel,better method is comment int system32/drivers/etc/host line containing :::1 localhost
Mikael Nygaard // March 24, 2008 at 5:32 pm |
#14 is the best solution.
Comment out the line in the host file with where ::1 is mapped to localhost. Worked straight away.
Edson Bassani // April 3, 2008 at 10:03 pm |
Fantastic! It saved me a lot of work!
Thanks so much!
Rob Bazinet // April 3, 2008 at 10:41 pm |
@Edson Great to hear. Helping out another person makes having a blog worth it.