Stuart A. answered 08/27/26
Programmer with over 15 years of experience with the C++ language.
This is a relatively easy thing to do, At the start of your code (at the start of the main() function)
bool debugLoop = true;
while (debugLoop)
{
System::Threading::Tasks::Task::Delay(1);
}
Rebuild your code and deploy it.
1) Put a breakpoint on the Delay line in visual studio.
2) start up the program
3) In visual studio open the Debug menu and select "Attach to Process..."
4) in the "Attach to Process" window find your program in the list of processes and attach to it.
5) in visual studio the debugger should hit the breakpoint at Delay.
If the breakpoint does not get hit you may have to stop the program and start again from step 2. This time in step 4 after selecting your program but before attaching you should set the Code Type to match your build.