When running a process under the debugger, I would like to start a child process in the same debugger.
Currently, I use
Process.Start(\"sample.exe\")
Assuming that sample.exe would be the host for code you want to debug, you can use project properties -> debug settings - choose action as an external program and provide path to sample.exe. The VS will start this executable and attach the debugger to it.
You should attach debugger to process you are starting. This could be done:
Here is code for "sample.exe" to attach debugger:
if (!Debugger.IsAttached)
Debugger.Launch();
Debugger.Break();
You should pass some parameter to "sample.exe" to verify if you need to attach debugger.
Process.Start("sample.exe", "Debug=true");
you can change the properties of your solution to start multiple apps.
an explanation is here Run Multiple projects
The MSDN article is here MSDN Article on running multiple projects
Visual Studio Debugger Team created an extension that does that automagically: https://marketplace.visualstudio.com/items?itemName=vsdbgplat.MicrosoftChildProcessDebuggingPowerTool