Attaching debugger at runtime in .Net
Whenever you write code that starts a new Process, your debugging experience is rather lacking – you’re stuck outside of the debugger. The following extension method will attach the Visual Studio debugger to your process: