I have a C# application that uses an external C++ DLL, and for some reason, I can't step into its functions anymore in Visual Studio. I used to be able to, but now, every time I try, I end up in a disassembly inside NTDLL instead of in my C++ function. If I even put a call to DebugBreak()
inside the C++ code, I get a bizarre error message like "a breakpoint has been hit that the CLR cannot handle."
I have "Enable native code debugging" turned on in the C# application's debug profile, and I've turned off "Hot Reload" and "Edit and Continue," which sometimes cause trouble for native code debugging, but I still can't step into the C++ code.
Here's my function declaration on the C# side:
[DllImport("Foo.dll"), SuppressGCTransition]
public static extern unsafe void DoSomething();
and here it is on the C++ side:
__declspec(dllexport) void DoSomething()
{
...
}
Why can't I step into this function? I'm using Visual Studio 2022, 17.5.3.