Start Debugging: Using Fiddler while VsHub is Running

  • Estimated read time: 4 min read
  • Written by Chad Campbell on Oct 7th 2016

Note: This post is a transcript to a video I posted. This video can be seen here.

Hi, I’m Chad Campbell. In this video I’m going to show you how to overcome a recent challenge with using Fiddler.

To show you the challenge I’m referring to, I’m going to jump into Visual Studio and start debugging an app. Now, with my app started, I’m going to launch Fiddler. Immediately, you’ll see tons of entries from localhost get written into the session list. In fact, if I just stop capturing traffic for a second and take a quick glance, you’ll notice these requests are all POSTing to a url that includes “vshub”. If you’re also experiencing this behavior, I encourage you to watch this video.

This behavior began when Microsoft began distributing an executable called VsHub with Visual Studio. In fact, if you open your Task Manager, and look through the Background Processes, you’ll see an executable named VsHub listed. This addition was included to allow communication between apps within Visual Studio. While powerful, this app can cause challenges if you’re used to using a tool like Fiddler. In this video, I’m going to show you how to continue using Fiddler even when VsHub is running.

There are two ways to get around this behavior: The first option is to disable the diagnostic Tools in Visual Studio. The second option is to use Filters in Fiddler. I’m going to show you both options in this video. If you have a preference, just click the link in the video now to jump to that section. If you don’t have a preference, just sit back and we’ll go through both approaches in order.

Disabling Diagnostic Tools

When you’re debugging a web app, it’s impractical to have all of these /vshub sessions popup in Fiddler. To get past this inconvenience, you can disable the diagnostic tools in Visual Studio.

The Diagnostic Tools in Visual Studio let you see the historical information of a session. You can learn about some of what’s provided by clicking this link. While valuable, sometimes, you might not want them. If you don’t want the Diagnostic Tools to record session data, you can disable them from the Visual Studio Tools window.

To disable these tools, click the Tools menu, go to Options… Then, expand the Debugging node and choose the General leaf. Once selected, scroll down to the bottom of the window. Ensure that the “Enable Diagnostic Tools while debugging” checkbox is unchecked. Once unchecked, click “OK”.

With the Diagnostic tools disabled, you can Start Debugging your app again. This time, you’ll notice that /vshub entries are no longer getting written to the session list. While this meets the original goal, you lose the rich diagnostic tooling provided in Visual Studio. There is another option if you’d prefer to use the diagnostic tools though.

Using Filters in Fiddler

Fiddler has the option to apply filters on sessions. With a filter, you can remove all sessions that have /vshub in the URL. To do that, I’m going to jump over to the “Filters” tab. In the first line, you can see a checkbox with the label “Use Filters”. I’m going to select this checkbox to tell Fiddler that I’m going to be using filters. Notice that when I select this checkbox, the checkbox in the tab itself also becomes selected. This gives you a quick way to see if filters are being applied without having to actually visit this tab.

Now, with filters in use, you need to tell Fiddler specifically what to filter out. To do that, scan down to the “Request Headers” group. In here, check the “Hide if URL contains” checkbox. Once selected, the related text field will be enabled. In this field, enter “vshub”. Now, when Fiddler sees a request with vshub in the URL, Fiddler will not show it in the session list.

This approach let’s you remove all vshub entries from Fiddler, while still using other tools, like the diagnostic tools in Visual Studio.

I hope this video improves your development experience. The transcript for this video can be found here. If you’d like to check out some of the training courses I’ve created, please visit here. I’m also available on these social networks. Finally, if this video was helpful, please click the “thumbs up” below and share this video with others. This lets me know that I’m adding value to your day. Without shares and likes, I might stop making these videos on YouTube.

Thanks for watching and have a great day.


Comments

comments powered by Disqus

Chad Campbell
Chad Campbell

Chad is an independent software professional. He has been named a Microsoft MVP five times. His books have been translated into multiple languages and distributed worldwide. He holds a computer science degree from Purdue University, where he also studied psychology.

Chad has built sites, apps, frameworks, libraries, and platforms using Java, .NET, and Node. He's ran his own startups and has created software for Fortune 100 companies. In short, Chad knows how to create software. From ideation to delivery. From start-to-finish.



Follow Chad Online