I have a C# unit test project that I would like to debug with mixed-mode debugging when I select Debug on a test from the Test Explorer.
In the properties dialog for non-SDK-style projects I can choose "Enable native code debugging" under the Debug tab as shown in this answer: https://stackoverflow.com/a/29245531/1555496. However the properties dialog for SDK-style project have been through a complete overhaul and the project-wide debug settings have been replaced with launch profiles.
I am not however launching with a launch profile when I choose Debug from the Test Explorer, so how do I enable mixed mode debugging now?
It turns out that Visual Studio uses what seems to be the first one of the launch profile for the test project when selecting Debug through Test Explorer.
You can also edit/create the Properties/launchSettings.json
file yourself
{
"profiles": {
"FooBar.MyTestProject": {
"commandName": "Project",
"nativeDebugging": true
}
}
}
It seems that the launch profile must be the first one listed and of type ("commandName") "Project" in order for it to be used. The name of the profile does not seem to matter however.