Fiddler2 and the ASP.NET Development server (Cassini)

August 29, 2007 22:33 by MartinHN

If you're debugging ASP.NET apps, it can sometimes be an advantage to be able to see the actual requests, and analyze file sizes, run-time rendered code and being able to 'fiddle' with the code on run-time. Well. Fiddler2 provides extremely useful features for doing so, but for people using the ASP.NET development server (Cassini) you have to do a few workarounds...

I'm running IE7 on Windows Vista (a great OS). IE7 automatically bypasses proxies for localhost, which is our main problem. When using the ASP.NET development server (Cassini), the URL looks like this one: http://localhost:49950/app/Default.aspx. When you open Fiddler2, you see that it hasn't monitored the traffic to the localhost address. This can be fixed by applying a period (.) after localhost. So change the URL to this:  http://localhost.:49950/app/Default.aspx

In my case, that wasn't enough. I got an error from Fiddler2 in my browser. If I disabled Fiddler2, it worked just fine. Then I added a rule to Fiddler2. To do this, in Fiddler2 go to Rules > Customize rules. (or hit CTRL + R). Find the OnBeforeRequest event-handler, and add the following code:

if (oSession.host.substr(0, 10)=="localhost.")
{
         oSession.host=oSession.host.replace("localhost.", "127.0.0.1");
}

Now - when you want to use Fiddler, just add a dot right after localhost in the URL, and Fiddler will start working!

That worked for me - hope it works for you too, if you're having problems.


Currently rated 5.0 by 3 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Add to: Facebook Add to: Digg Add to: Del.icio.us Add to: Reddit Add to: Furl Add to: Yahoo Add to: Spurl Add to: Google Add to: Technorati
Tags:
Categories: ASP.NET | C# | Cassini | Fiddler2
Actions: E-mail | Permalink | Comments (5) | Comment RSSRSS comment feed

Comments

January 20. 2009 05:01

Busby SEO Test

Happy New Year, i'm having fun in reading your post, keep up the good work.

Busby SEO Test

April 4. 2009 18:36

movers

thank u great post
love it

movers

April 4. 2009 18:36

jammer

made it nice
great post

jammer

June 19. 2009 23:46

franchises for sale

hmmmm i'm hungry. Ooops, focus matthew focus matthew focus. Just browsing, thinking of food and browsing. Post some more Smile MunchMunch

franchises for sale

June 23. 2009 09:58

SEO 対策 沖縄 ホームページ制作

thanks for the code.

SEO 対策 沖縄 ホームページ制作

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading



Powered by BlogEngine.NET 1.4.0.0
Theme by Mads Kristensen

About the author

Martin Høst Normark

Senior Frontend Developer at TraceWorks.

View Martin Høst Normark's profile on LinkedIn

Xbox 360

Zune

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in  anyway.

© Copyright 2008