Visual Studio 2015 Update 1 spamming localhost

I installed Visual Studio Update 1 yesterday and now when running ASP.NET services locally on IIS (not the express version). I am seeing hundreds of requests per second to the address

 http://localhost:49155/vshub/ca9dea4b016f45c68a6a8c1a07809eb4/DataWarehouseModule/dataWarehouse/getStatus/

What is causing this and is it preventable?

19801 次浏览

这是将信息发送回 VSHB 进程的调试器。它是两个进程之间的内部通信,因此部分调试器数据收集可以发生在进程外。

它有助于提供调试器工具提示、性能信息、历史调试经验等。因此,在不严重破坏高级调试器特性的情况下,没有办法关闭它。

You can turn some of these features off (though other features may still rely on Vshub to do out-of-process work in the background):

Tools > Options > Debugging > General > [  ] Enable Diagnostic Tools while debugging

通信纯粹是本地的,不会造成严重的开销或问题。你有什么特别的原因想处理掉它吗?像 Fiddler 这样的工具可以配置为对进程进行过滤,因此忽略这种流量应该很简单。

防止 fiddler 占用 CPU 的另一个选项是在 fiddler 中编写一个规则来忽略这些请求。Goto Rules > Customize Rules... 查找 OnBeforeRequest 函数并添加

if(oSession.oRequest.headers["host"]=="localhost:49155"){
oSession["ui-hide"] = "true";
}

我的看起来像这样:

static function OnBeforeRequest(oSession: Session) {
if(oSession.oRequest.headers["host"]=="localhost:49155"){
oSession["ui-hide"] = "true";
}
}

正如@Matrix 指出的那样,根据 VS 的版本,端口可能会有所不同。@tedd-hansen 的解决方案可能适用于所有版本的 Visual Studio。

if(oSession.oRequest.headers["host"].StartsWith("localhost")
&& oSession.PathAndQuery.StartsWith("/vshub/")) {
oSession["ui-hide"] = "true";
}

Here's some discussion about this issue on github to get a better understanding of what's going on; https://github.com/aspnet/Mvc/issues/3655

下面是另一篇关于 SO 的文章: visual studio 2015 vshub is spamming fiddler

我知道这不是解决问题的办法,但是它可以帮助到这里来的其他人(比如我)。

扩展了 Kyle Up 给出的答案。将其添加到“ OnBeforeRequest”方法中会更通用一些,并且会阻止所有 localhost/vshub/debug 消息填充 Fiddler 中的视图。

if(oSession.oRequest.headers["host"].StartsWith("localhost")
&& oSession.PathAndQuery.StartsWith("/vshub/")) {
oSession["ui-hide"] = "true";
}

Since this has turned into ways to make Fiddler ignore the requests, the easiest way I've found is to go to the Filters tab, Request Headers section, check the "Hide if URL contains" box and enter "/vshub/".

Hiding with Filters

This is an easier alternative to hide the vshub localhost traffic.

转到 Tools > Fiddler Options > Connections 选项卡并将 http://localhost:49155添加到旁路列表。这将跳过所有发布到该 Url 的流量。