I know I can start a process in code with Process.Start()
.
Is it also possible to attach the debugger to that process?
Not from code per se , but just a way to do it?
I know I can start a process in code with Process.Start()
.
Is it also possible to attach the debugger to that process?
Not from code per se , but just a way to do it?
You can do this in pretty much any debugger worth its salt.
Visual Studio has one that should fit your needs.
If you need a little more advanced control, try OllyDbg, which is a disassembler, so you can actually manipulate your program at the assembly level. This will give you complete control, but it might be information overload as well.
You can do this in your code.
Usage:
You can attach to a running process using
Tools | Attach to Process
. If it's a Web Application, you can attach to it by attaching toaspnet_wp.exe
orw3wp.exe
.To answer your question on how to attach to a process programmatically:
Here are other Stack Overflow questions that deal with that:
In visual studio click Tools | Attach to process. Then select appropriate service.
In Visual Studio 2015, click 'Debug > Attach to process' in the menu. Alternatively, there is a shortcut key Ctrl+Alt+P.