With the "Enable native code debugging" project option checked, go to VS->Tools->Options, then Debugging->General and ticking the box for "Use Managed Compatibility Mode".T
The driver program should execute and perform debugging without further issue.
This issue seems to be a compatibility issue with Visual Studio debugging engine, with an excerpted explanation from Microsoft Documentation <https://docs.microsoft.com/en-us/visualstudio/debugger/general-debugging-options-dialog-box here>:
Use Managed Compatibility Mode
Replaces the default debugging engine with a legacy version to enable these scenarios:
- You are using a .NET Framework language other than C#, VB, or F# that provides its own Expression Evaluator (this includes C++/CLI).
- You want to enable Edit and Continue for C++ projects while mixed mode debugging.
Note that choosing Managed Compatibility mode disables some features that are implemented only in the default debugging engine.
Best Answer