强制 Visual Studio 使用主机名 localhost 启动开发服务器。 (末尾有句号)
是否可以更改开发服务器在 Visual Studio 2008 中启动的主机名?最终我希望 Visual Studio 直接在 http://localhost.:xxxx/ 上启动(注意句点) 。当我进行更多的 ajax 类型调用时,我发现我需要更频繁地使用 fiddler 等工具来检查流量来检查响应/请求。 (Fiddler 无法看到通过 http://localhost/ 的请求,因为它们不遍历常规网络堆栈)。
我查看了网络服务器配置页面,但没有任何内容跳出。
我并不是特别想走在盒子上配置 IIS 的路线,但会考虑一个令人信服的答案。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果您的设置很简单,您可以尝试 v2.2.4.0 中添加的新选项。
在注册表内的 HKCU\Software\Microsoft\Fiddler 下,添加一个名为 HookWithPac 的新 Reg_SZ,并将值设置为 True。您应该发现 Fiddler 现在使用简单的 PAC 脚本注册为系统代理,而不是手动指定 127.0.0.1:8888。这反过来又导致 IE 将 LocalHost 流量发送到 Fiddler。
请告诉我这是否适合您!
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!
我尝试了 Eric 的建议,但效果不佳 - Fiddler 正在跟踪从我的 Visual Studio 开发服务器到其他服务器的流量,但仍然没有注册从 IE 到本地主机的流量(在 :xxxx 端口号之前没有点)。 (Windows 7、Visual Studio 2008、Fiddler 2.3.1.0、IE8)。
我必须进入 Fiddler 选项 ->连接与选中“使用 PAC 脚本”。现在我看到了所有的交通。
我还要感谢如此出色的软件; Fiddler 是我用过的最有用的免费工具!
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!
您可以将代码添加到 Global.asax 以重定向到
localhost.
(如果您还没有来自它)。但是,请确保此类代码不会最终投入生产。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.您也可以点击 http://localhost.:2147 这将导致 fiddler 捕获到 localhost 的流量。
You could also just hit http://localhost.:2147 which will cause fiddler to trap traffic to localhost.