2
votes

With 'enable native code debugging' set on the unit test project's Debug settings tab, I am unable to step into native code when debugging unit tests.

Looking at the Modules window, it's clear that only managed code is being debugged - there are no native DLLs listed.

Is there a way to debug native code in Visual Studio unit tests?

1

1 Answers

0
votes

In Visual Studio 2013, and using googletest with the GoogleTestRunner extension: I couldn't properly debug via the Test Explorer's "Debug this test" menu. I had to debug into the unit test project's executable itself (right click on unit test project, hit Debug).

By "not properly debug" I mean: I was able to stop at a breakpoint, and see a data value by hovering over a variable in the code window - but I didn't get any typical debugger windows (call stack, autos, locals, modules, etc.) nor were there any such windows available under the Debug/Windows menu item!

Not sure if this is your problem, since you didn't specify whether you're using Visual Studio's built-in native C++ unit tests or not. But I believe it might be an issue with running tests inside the Test Explorer.