title: How to start a child process in the same Visual Studio debugging session as the parent, programmatically?
body: <p>When running a process under the debugger, I would like to start a child process in the same debugger.</p>
  
  <p>Currently, I use</p>
  
  <pre><code>Process.Start("sample.exe");
  </code></pre>
  
  <p>I want it to be something like this:</p>
  
  <pre><code>if (Debugger.IsAttached)
      // start "sample.exe" in the same debugging session
  else
      Process.Start("sample.exe");
  </code></pre>
  
  <p>I could pass a flag to the child process that instructs it to call <code>Debugger.Launch()</code>, but that won't catch start up errors, and it results in a debugging session where some features are not enabled (such as edit and continue, etc). It's preferable to have the debugger launch the process directly.</p>