Fiddler replaying requests to the ASP.NET Development Server: XP works but Vista not, or “when localhost is not 127.0.0.1 in Fiddler 2”
Posted by jpluimers on 2009/12/09
Today, I bumped into something utterly strange: requests replayed through Fiddler 2 to a locally running ASP.NET Development Server on Vista using localhost URLs did not give a connection.
I use ASP.NET from both C# and Delphi Prism. Most of my development work is on Windows XP (see notes below) but I test on many platforms.
Moving one of the projects from XP to Vista, and testing with Fiddler, I found that when using Fiddler 2:
So on Vista – contrary to XP – localhost requests from Fiddler were in fact being sent to the external network adapter on Vista, and the 127.0.0.1 requests to the internal network adapter.
Since the ASP.NET Development Server is bound only to the internal network adapter, external requests don’t work (boy, I wish they did, it would make some of my debugging so much easier!).
Both URL’s work fine when running on the same setup in XP SP3.
Both URL’s work fine on Vista when executed from within Internet Explorer, Chrome or FireFox (I could have tested more browsers, but you get the picture: Fiddler behaves differently than the web browsers; I tested Fiddler versions 188.8.131.52 and 184.108.40.206).
So why does it fail in Vista, despite the fact that the HOSTS file looked like this:
## Copyright (c) 1993-2006 Microsoft Corp.
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
And both HOSTS file also had the right security settings:
hosts NT AUTHORITY\SYSTEM:(I)(F)
I’m glad that the 127.0.0.1 notation in the URL works from Fiddler 2, but I’m still a bit confused: I was “raised” in TCP/IP land with a trust in HOSTS files. Apparantly I can’t.
I have yet to test disabling the IPv6 stack on the Vista machine to see if this solves the issue (like it solves a similar issues here and here).
I’d rather not disable IPv6, because some of the networks do use IPv6, but testing is on the todo-list.
I also need to regression test this against Windows 7. So that is also on the todo-list.
PS: Some notes:
The HOSTS file is formally in %windir%\System32\drivers\etc\hosts, usually in C:\Windows\System32\drivers\etc\hosts, pitty that WordPress does not allow for URL’s like file:///C/Windows/System32/drivers/etc/hosts, they get truncated to ///C/Windows/System32/drivers/etc/hosts .
I still use XP and Office 2003 for a lot of work. Partially because I’m old skool, but mainly because I dislike the fact that a very large company suddenly changed keyboard shortcuts (I did mention old skool) that have been in place for so long not only in their OS, but also in their Office Suites.
So I now use Vista and/or Windows 7 as host operating systems (because they support more than 4 gigs of memory) and mostly XP in development guests.