问题
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:
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!
回答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!
回答3:
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.
回答4:
You could also just hit http://localhost.:2147 which will cause fiddler to trap traffic to localhost.
来源:https://stackoverflow.com/questions/1577772/force-visual-studio-to-start-development-server-using-the-hostname-localhost-w