Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while profiling with VS: Unable to open profiler driver

I am running Windows 8 with UAC completely disabled which is possible to do by changing a registry setting (setting it to "Never notify" no longer completely disables it in Windows 8).

When I try to profile C# code through Visual Studio I get the following error (clicking yes doesn't resolve the problem):

Unable to open profiler driver, would you like to upgrade credentials of [username]?

Running vsperfcmd /Admin:Driver,START from the command line says:

Error VSP1449: Unable to start VSPerfDrv100. This driver has been blocked from loading Try using the /Admin switch of VSPerfCmd from an elevated environment.

I obviously am using an elevated environment, since with UAC completely disabled I no longer have two security tokens but only the administrator security token.

How can I resolve this problem?

like image 784
Thomas Bonini Avatar asked Jan 03 '13 21:01

Thomas Bonini


2 Answers

The blog post here 'The Visual Studio Profiler on Windows 8' states this:

Windows 8 added logic to prevent all incompatible versions of the profiling driver from starting (2010, 2008, and 2005).

This means that when you try to start profiling with an incompatible version you will receive the message “Error VSP1398: The monitor was unable to start the VS performance driver. Access is denied. Consider using the /Admin:Driver,Start and /Admin:Security options of VSPerfCmd from an elevated environment.

Which will result in the following behavior when running Visual Studio 2010 (or earlier) on Windows 8.

  • CPU Sampling, .NET Memory Allocation, and Concurrency profiling will fail to start on Windows 8. The only workaround on Windows 8 is to use Visual Studio 2012 Professional or higher, or to profile on Windows 7.

  • Instrumentation profiling can be launched, but the application and elapsed times will be exactly the same.

like image 98
Simon Mourier Avatar answered Oct 20 '22 11:10

Simon Mourier


Try adding "Full Controll" permissions to the directory where the driver "VSPerfDrv100.sys" is located.

You can find this using "sc qc VSPerfDrv100".

For an x64 PC it should be "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Performance Tools\x64"

like image 39
Daro Avatar answered Oct 20 '22 12:10

Daro