I am profiling a C # program from Visual Studio 2013. I go to Analyze -> Performance and Diagnostics to start the wizard. This gives me a choice of profiling method. If I choose the default processor selection, then profiling, and I can see the results. However, if I choose the third option, .NET memory allocation, then after completing my application, I see empty results and this error in the Visual Studio output window:
VSP2340: Environment variables were not properly set during profiling run and managed symbols may not resolve. Please use vsperfclrenv before profiling
All the documentation that I saw on the Internet suggests that vsperfclrenv is for use with the standalone profiler and is not needed when starting the profiler directly from Visual Studio. However, to be safe, I tried to set the necessary environment variables from the command line window, and then start the IDE directly from this window so that it would take the environment:
C: cd "\Program Files (x86)\Microsoft Visual Studio 12.0\Team Tools\Performance Tools\x64" vsperfclrenv /samplegclife /tracegclife /globalsamplegclife /globaltracegclife "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe"
Then I went to the performance wizard inside Visual Studio, as before. But the result is the same; I still see the VSP2340 trying to analyze the results. What am I doing wrong?
I note that the wizard has four types of profiling: processor selection, toolkit, memory allocation, and resource competition. This does not quite correspond to the parameters proposed by vsperfclrenv , which speaks only about sample inspection and trace profiling (with various service options for each of them: my program is an application, not a service, but I turned on all the parameters, I am sure).
Could there be an additional environment variable needed to profile memory allocation? Or is Visual Studio's message about vsperfclrenv misleading?