4

Is it possible to change the hostname that the development server fires up in visual studio 2008? Ultimately I would like visual studio to start directly on http://localhost.:xxxx/ (note the period). As I am doing more ajax type calls I find that I need to inspect traffic more often using tools like fiddler to check responses/requests. (Fiddler cannot see requests over http://localhost/ as they do not traverse the regular network stack).

I looked through the web server configuration page but nothing jumped out.

I don't particularly want to go the route of configuring IIS on the box but would consider it with a compelling answer.

Charles
  • 50,943
  • 13
  • 104
  • 142
Michael Gattuso
  • 13,020
  • 2
  • 25
  • 29

4 Answers4

7

If you have a simple setup, you might try a new option added in v2.2.4.0.

Inside the registry, under HKCU\Software\Microsoft\Fiddler, add a new Reg_SZ named HookWithPac with the value set to True. You should find that Fiddler now registers as the system proxy using a simple PAC script rather than manually specifying 127.0.0.1:8888. This, in turn, causes IE to send LocalHost traffic to Fiddler.

Please let me know if this works out for you!

EricLaw
  • 56,563
  • 7
  • 151
  • 196
2

I tried Eric's suggestion and this half-worked - Fiddler was tracking traffic from my Visual Studio development server to other servers but still wasn't registering traffic from IE to localhost (without the dot before :xxxx port number). (Windows 7, Visual Studio 2008, Fiddler 2.3.1.0, IE8).

I had to go into Fiddler options -> Connections & check 'Use PAC Script'. Now I see all traffic.

I would also like to say thanks for such a great piece of software; Fiddler is the single most useful free tool I have ever used!

tomfumb
  • 3,669
  • 3
  • 34
  • 50
1

You could add code to Global.asax to redirect to localhost. if you're not coming from it already. However, make sure that such code doesn't end up in production.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
  • Thanks, that is an idea. Hopefully I don't have to resort to it but it's worth bearing in mind. – Michael Gattuso Oct 16 '09 at 13:22
  • Interestingly enough the request.Url does not retain the period in the url. In evaluating this approach I had to rely on the presence of localhost. in the host header that is passed with the request. – Michael Gattuso Oct 16 '09 at 20:13
  • This is just a helpful update for others thinking about this approach. After trying this method out for a a couple of days I notice that debugging shuts down after a little while using the redirect - not sure why - I guess VS picks up the redirect and assumes you are off the site. – Michael Gattuso Oct 27 '09 at 13:25
0

You could also just hit http://localhost.:2147 which will cause fiddler to trap traffic to localhost.