visual studio 2015 vshub is spamming fiddler

Visual Studio-2015Fiddler

Visual Studio-2015 Problem Overview


I have read: https://stackoverflow.com/questions/31452435/how-do-i-disable-vshub-exe-in-the-system-tray/32542835#32542835 and https://connect.microsoft.com/VisualStudio/feedback/details/1919828/hundreds-of-calls-second-to-vshub-and-browserlink-is-off

I would prefer to not disable vshub; I just want it to be more quiet when I am using fiddler. Right now it spams everything else out, and I cannot do general debugging.

Does anybody know a workaround? Can I block vshub from showing up in fiddler without blocking the rest of locahost?

Visual Studio-2015 Solutions


Solution 1 - Visual Studio-2015

This is a relatively new problem because System.NET used to ignore proxy settings for localhost, and therefore Fiddler wouldn't see the traffic by default (http://docs.telerik.com/fiddler/Configure-Fiddler/Tasks/ConfigureDotNETApp) - see bottom section.

Now this no longer appears to be the case, so I expect more people will have the same question. Fiddler supports several ways to filter requests, though nothing that the client can control (which is probably good, since you wouldn't want malware from excluding its traffic). The most appropriate and simplest mechanism in this case is probably to set a filter for any url that contains localhost or vshub. You can do that by:

  1. Click the filters tab (it's a top-level tab, at the same level as inspectors, statistics, etc.),
  2. Check the checkbox labeled 'Use Filters'
  3. Scroll down and find the checkbox labeled 'Hide if URL contains'.
  4. Check that box, and enter either localhost or vshub into the accompanying textbox.
  5. You should see the vshub traffic stop immediately.

This filter will persist, so if you shutdown Fiddler and start it up again later, it will still be set.

Solution 2 - Visual Studio-2015

These requests seem to come from the Diagnostic Tools window which runs when debugging. Seems as though they provide the monitoring information for Memory Usage and CPU Usage.

You can stop the requests if you don't care to see the usage information by disabling Memory/CPU monitoring in the Diagnostic Tools dialog box.

  • Open the Diagnostic Tools window (Debug -> Windows -> Show Diagnostic Tools)
  • Click the "Select Tools" drop-down and un-check Memory Usage and CPU Usage.
  • Stop debugging and next time you start debugging you should no longer see the requests being made to vshub

Solution 3 - Visual Studio-2015

For me, the fix to stop "spamming" to Fiddler4, instead of a Fiddler filter, which I could have chosen to do, was to change a Visual Studio 2015 option:

Visual Studio 2015 -> Tools -> Options -> Debugging -> General -> uncheck/disable "Enable Diagnostic Tools while debugging"

enter image description here

VSHUB.exe service must be the service that assists Diagnostic tools while debugging and is continously pinging your website/webapi/web app you are debugging. I do not need debugging. Diagnostic tools at this time so I just disabled it in Visual Studio

In regards to disabling VSHUB.exe, I was tempted to do that, until I read from someone at Microsoft, its best to not disable it for a better Visual Studio 2015 experience and they add new features to Visual Studio that utilize VSHUB.exe over time:

https://stackoverflow.com/questions/31452435/how-do-i-disable-vshub-exe-in-the-system-tray

Solution 4 - Visual Studio-2015

The issue is caused by Visual Studio's Diagnostic Tools while debugging.

You can disable them by going to ToolsOptions, and then following the steps: enter image description here

Solution 5 - Visual Studio-2015

This is an easier alternative to hide the vshub traffic.

Go to Tools > Fiddler Options > Connections tab and add http://localhost:49155 to the bypass list. This will skip all traffic posted to that URL.

*Edit: Fiddler may need to be restarted after adding to the bypass list.

Solution 6 - Visual Studio-2015

The easiest way to resolve this is to setup a filter in fiddler. In the OnBeforeResponse, add the second if with your vshub host/port:

  static function OnBeforeResponse(oSession: Session) {
    if (m_Hide304s && oSession.responseCode == 304) {
        oSession["ui-hide"] = "true";
    }
    
    if (oSession.HostnameIs("localhost:49155")){
        oSession["ui-hide"] = "hiding vshub"; // String value not important
    }


    }

Solution 7 - Visual Studio-2015

SpokaneDJ's answer was very helpful for me and worked great, but I don't spend a lot of time with Fiddler so it took me a minute to remember how to do this! Here are the specific instructions.


First, within the Fiddler UI, go to Rules > Customize Rules. Search for the OnBeforeResponse function. It should look like this:

static function OnBeforeResponse(oSession: Session) {
  if (m_Hide304s && oSession.responseCode == 304) {
    oSession["ui-hide"] = "true";
  }
}

Now add the following if block after the existing one (substituting your vshub host/port if different):

    if (oSession.HostnameIs("localhost:49155")){
      oSession["ui-hide"] = "hiding vshub"; // String value not important
    }

Your OnBeforeResponse function should now look like this:

  static function OnBeforeResponse(oSession: Session) {
    if (m_Hide304s && oSession.responseCode == 304) {
        oSession["ui-hide"] = "true";
    }
    
    if (oSession.HostnameIs("localhost:49155")){
        oSession["ui-hide"] = "hiding vshub"; // String value not important
    }
  }

Solution 8 - Visual Studio-2015

The above didn't work for me, as such. It seemed to shut down ALL fiddler monitoring of the localhost host.

A bit of judicious googling gave me another solution - to block the port specifically by adding this to the bottom of the OnBeforeRequest section:

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

This seems to block the port from being reported in Fiddler, without disrupting further localhost traffic.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionGreg NetlandView Question on Stackoverflow
Solution 1 - Visual Studio-2015Anson HortonView Answer on Stackoverflow
Solution 2 - Visual Studio-2015AlexView Answer on Stackoverflow
Solution 3 - Visual Studio-2015Brian OgdenView Answer on Stackoverflow
Solution 4 - Visual Studio-2015SergeyView Answer on Stackoverflow
Solution 5 - Visual Studio-2015mikroView Answer on Stackoverflow
Solution 6 - Visual Studio-2015SpokaneDJView Answer on Stackoverflow
Solution 7 - Visual Studio-2015Brian LacyView Answer on Stackoverflow
Solution 8 - Visual Studio-2015Rich HowardView Answer on Stackoverflow