Visual Studio 2019: show CPU profiling in C++ DLL called from C# application

TSteo 1 Reputation point
2021-03-12T02:27:20.223+00:00

I want to use Visual Studio 2019 to show me CPU profiling for code inside a C++ DLL that's called by a C# application. I have the code for the DLL and the application all in one solution, and it's built for Debug. The first time I tried it, it worked: the "CPU Usage" window showed me a call stack with CPU usage from the C# application all the way down into the C++ DLL. Then I restarted the IDE and did it again, and now the stack shows only the C# code. Where it calls down into the DLL, it shows only "dynamicClass.IL_STUB_PInvoke(string)". The "Load Symbols" and "Show External Code" options don't help. I didn't change any settings in the project or the IDE. Rebuilding the project didn't help either.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,604 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,238 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,527 questions
{count} votes