Mike Bosch's Blog on .NET

Agile enterprise architecture in .NET, SOA, WCF, WS-*, AJAX, MVC, Sharepoint and more...

Using Fiddler with ASP.NET's default local server

If you've ever done any kind of AJAX debugging, you may have used Fiddler to figure out exactly what is going over the wire.  Fiddler is a neat little tool that let's you analyze the traffic between the browser and the application.  It shows session information, cookies, and a lot more.  One thing that's not clear right away is how to use it with the ASP.NET local server. 

If you run your typical ASP.NET application with the default server, you'll notice that Fiddler is not capturing any traffic.  To remedy this situation, you can simply add a period ('.') to the end of "localhost" in the address bar (http://localhost.:8181/mywebapp).  This will allow you to view your application’s traffic data with Fiddler.

Posted: Oct 09 2007, 12:27 PM by MikeBosch | with 12 comment(s) |
Filed under:

Comments

Ken Cox said:

Interesting tip, but I get:

[Fiddler] Connection to localhost. failed.<BR>Exception Text: No connection could be made because the target machine actively refused it  

# October 9, 2007 1:15 PM

Laurent Kempé said:

# October 9, 2007 5:24 PM

MikeBosch said:

You might also want to check out this post:

groups.msn.com/.../bugs.msnw

If you're using Vista, it may have something to do with IPv6 vs. IPv4.

# October 9, 2007 5:27 PM

Srikanth Bhakthan said:

You can also use the machinename.

Ex:http://machinename/mywebapp

# October 10, 2007 1:45 PM

Wil Peck said:

Another way around this is to modify your hosts file.

For Example:

127.0.0.1 local

This is not much better than using your computername.  The only difference is you won't have to add a rule to allow access on port 80 in your firewall software.

# October 18, 2007 1:01 PM

Mohammad Azam said:

Awesome tip!

# October 21, 2007 9:56 PM

AzamSharp : Using Fiddler With localhost said:

Pingback from  AzamSharp : Using Fiddler With localhost

# October 21, 2007 10:00 PM

samham said:

To solve the error:

[Fiddler] Connection to localhost. failed.

Exception Text: No connection could be made because the target machine actively refused it

Tools -> Fiddler Options -> remove 'enable IPv6'

# February 24, 2008 1:39 PM

Atit said:

Not working with asp.net mvc application

# December 16, 2008 11:20 AM

Marcelo Ampuero said:

This work for me:

1.- Tools -> Fiddler Options -> remove 'enable IPv6'

2.- Add a period (localhost./mywebapp)

3.- On vista disable ipv6 localhost on C:\Windows\System32\drivers\etc\hosts, changing

::1             localhost  to

#::1             localhost

# February 13, 2009 3:31 PM

Learning by Failing » No connection could be made because the target machine actively refused it: said:

Pingback from  Learning by Failing &raquo; No connection could be made because the target machine actively refused it:

# February 24, 2009 5:28 PM

code0724 said:

[Fiddler] No connection could be made because the target machine actively refused it

# May 4, 2009 10:52 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)