Can I programmatically resume Visual Studio Profiler running with profiling paused?

I have a simple case where I just want to postpone the start of profiling to a specific part of my automated test case. I want to avoid user interaction. I run it from Performance Explorer in VS2013 Pro. I have a vstest.console.exe session (without tools), which in turn runs tests in my Test.dll (with tools). It works great when I start it without profiling. But trying to resume the profiler from Test.dll does not work. I refer to Microsoft.VisualStudio.Profiler in my Test.dll and then call: DataCollection.ResumeProfile(ProfileLevel.Global, DataCollection.CurrentId); The moment I want to resume profiling. This does not work. Is there any way to do this?

+5
source share

Source: https://habr.com/ru/post/1211782/


All Articles