views:

321

answers:

2

If the main process is currently being debugged in Visual Studio, how can I have it so any new processes it spawns are also attached to the same instance of Visual Studio as the main process is?

Currently the new processes are created just with a CreateProcess call, however I can add extra code or use a different API altogether if needed, as well as making changes to the project or solution configurations (each process has its own project in a single solution).

+1  A: 

http://www.wintellect.com/CS/blogs/jrobbins/archive/2009/07/20/can-the-vs-debugger-automatically-attach-to-any-child-spawned-by-a-process-being-debugged.aspx

Devon_C_Miller
A quick summary - the VS debugger doen't support it; best bet is to use WinDBG (which does) or add the child process filename to the "Image File Execution Options" registry key.
Michael Burr
A: 

Sort of dupe, but the answer is here: Attaching to a child process automatically in Visual Studio during Debugging

It's a good question, though!

vehomzzz