I am profiling a C# program from Visual Studio 2013. I go to Analyze -> Performance and Diagnostics to start the wizard. It gives me a choice of profiling method. If I ch
Have you tried to run a Visual Studio Command Prompt (as administrator) and run command vsperfclrenv / globalsampleon? After thad you may need to reboot.
This may be related to administrative privileges. In my case, I know of two workarounds:
vsperfclrenv /samplegclife
. Window title changes from Administrator: Developer Command Prompt for VS2012
to Administrator: VSPerf Sampling Attaching and Allocation Profiling with objects lifetime 'ON'
. Then "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe"
.The second approach looks just what the original poster did, except that instead of an ordinary cmd.exe window, I used Run as administrator with the Developer Command Prompt. For me, when I do not run as administrator, I get the VSP2340 error.
I have been experiencing very similar symptoms with a slightly different environment: Windows 7, as a normal user (not in the local Administrators group), starting Visual Studio 2012 from the Start Menu, with Avecto Defendpoint to grant elevated privileges to the Visual Studio executable, CPU profiling produced normal results but .NET memory allocation sampling results were blank. Output window said:
Profiling started.
Profiling process ID #### (xxxx).
Process ID #### has exited.
Data written to C:\path\to\solution\xxxxyymmdd.vsp.
Profiling finished.
VSP2340: Environment variables were not properly set during profiling run and
managed symbols may not resolve. Please use vsperfclrenv before profiling.
Profiling complete.
For CPU profiling runs, instead of VSP2340, I get a long listing of Loaded symbols for [full/path/to/dll]