I think you do not understand what Debugger.Launch() does. It functions as a hard-coded breakpoint.
When your program enters Debugger.Launch() , the Just-In-Time-Debugging window will appear (provided that Visual Studio is installed on the computer. At this point, your program is stopped - it does not continue to work.
If you select an instance of VS, it will start and be stopped on the line using Debugger.Launch() , as if you hit a breakpoint.
Therefore, there is no reason for a while () loop. You can just call Debugger.Launch() when you want to stop the program to see something.
But the usefulness of Debugger.Launch() questionable. You can use breakpoints much easier, and with breakpoints there is no danger of accidentally leaving it in the finished product.
Hiredmind
source share