How do you debug and step into native C/C++ code when P/Invoke?


I am developing a .NET core (.NET Standard 1.6) application in VS2015. The application calls C++ code via P/Invoke. Now I need to step into the C/C++ code of my native dll project.

In regular .NET application, by enabling unmanaged code debugging in the property window of the application, we can step into the C/C++ code directly:

But I can’t find such option on a .NET core project. And I know that I can attach the debugger to the application to debug native code only, but that’s not suitable for my case.

Again, I want to debug from managed C# code into native C/C++ code.

Any ideas?

Maybe I should switch back to .NET Framework so I can debug the native code. It’s really hard to debug by printf. :frowning:

I have posted the same question on StackOverfolw.


OK… Someone told me that this is not supported.

And I found an walkaround on this. Debug native only…

.NET Foundation Website | Blog | Projects | Code of Conduct