Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't get Visual Studio Diagnostic Tools to work

I'm having some problems getting the Diagnostic Tools in Visual Studio 2015 (with Update 3) to start. I build and launch a project in Debug Mode, the Diagnostic Tools window pops up with the text

Starting Diagnostic Tools...

and after around ten minutes this text disappears but the Diagnostic Tools window remains (with nothing on it). There is no output in the Diagnostics Hub, either. This happens on both x86 and x64 platforms, running VS as administrator doesn't help either.

VShub.exe an the Visual Studio Standard Collector Service are both running.

EDIT: It now fails sooner and the Diagnostic Tools window gives thhe following message:

The diagnostic tools failed unexpectedly. The Diagnostics Hub output in the Output window may contain additional information.

And now the Diagnostics Hub window has the following message:

VsHub failed to locate/start service.

like image 347
imp0s5ible Avatar asked Aug 30 '16 18:08

imp0s5ible


People also ask

How do I enable diagnostic tools in Visual Studio?

When you start debugging in Visual Studio by selecting Debug > Start Debugging, or pressing F5, the Diagnostic Tools window appears by default. To open it manually, select Debug > Windows > Show Diagnostic Tools. The Diagnostic Tools window shows information about events, process memory, and CPU usage.

How do I run a diagnostic tool?

In Windows 10: Go to Start , then select Settings > Privacy > Diagnostics & feedback. Make sure that the Diagnostic data viewer setting is turned On, and then select Diagnostic Data Viewer.

How do I run a performance profiler in Visual Studio?

Open the Performance Profiler by choosing Debug > Performance Profiler (or Alt + F2). For more information on using the CPU Usage or Memory usage tool in the Performance Profiler vs. the debugger-integrated tools, see Run profiling tools with or without the debugger.

How do I use the diagnostic tool in Visual Studio 2015?

You can enable it manually by selecting Visual Studio Options from the menu (Tools -> Options). From Options, choose Debugging -> General and check the 'Enable Diagnostic Tools while debugging' checkbox. After enabling it from Visual Studio 2015, the new Diagnostic Tools window will appear.

What's new in Visual Studio 2015 diagnostic tools?

Visual Studio 2015 Diagnostic Tools made it easier for developers to have a performance analysis and review before the application goes live. As a Visual Studio 2015 developer, you can get detailed application insights while you are debugging code. By default, the Diagnostic Tools window opens automatically while debugging.

How do I start diagnostic tools without debugging?

To do this go to Debug -> Start Diagnostic Tools without Debugging, select CPU Usage, and click Start. The following startup project types and debugging configurations are supported by the Diagnostic Tools window in Visual Studio 2015: The Diagnostic Tools window currently does not support:

How do I check for performance issues in Visual Studio?

Visual Studio Diagnostic Tools The profiling and diagnostic tools built into Visual Studio are a good place to start investigating performance issues. These tools are powerful and convenient to use from the Visual Studio development environment. The tooling allows analysis of CPU usage, memory usage, and performance events in ASP.NET Core apps.

Does the Diagnostic Tools window support Windows Store projects?

The Diagnostic Tools window currently does not support: Windows Store projects that are using JavaScript. Windows Store projects that are running on a Windows Phone. Debugging when Managed or Native Compatibility Mode is checked in Tools –> Options –> Debugging.


1 Answers

This is an environmental problem, software that is running on the machine is interfering with the proper operation of VSHub.exe. Underlying issue is that it operates a lot like malware does, attaching itself to another process (the program you are trying to debug) and then using a named pipe to talk to another process (the IDE). The "failed to locate/start service" is the diagnostic message for not being able to connect the named pipe.

This behavior is enough to raise the hackles or trigger a bug in the kind of software that tries to stop malware from doing this. Products like Avast, AVG, Sophos, ESET, McAfee have been identified before for being especially unfriendly on a developer's machine. Avast in particular needs to be singled-out as a product that has never stopped causing trouble.

The test is simple, just de-activate the product and check that the delay is now gone. You might limp along by adding specific exclusions for vshub.exe and devenv.exe, but choosing a product more compatible with what a programmer does every day is wise. I've seen, and personally experienced, very few problems with the antimalware solution included with Windows.

like image 178
Hans Passant Avatar answered Sep 22 '22 15:09

Hans Passant