views:

961

answers:

3

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.

+1  A: 

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
Thanks, that is an idea. Hopefully I don't have to resort to it but it's worth bearing in mind.
Michael Gattuso
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
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
+4  A: 

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 -MSFT-
Eric - seems to work perfectly. Fiddler is such a great tool - thanks.
Michael Gattuso
Thanks for confirming! I'll add UI for this at some point.
EricLaw -MSFT-
A: 

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

Tim Leclair