title: Is there a way to detect if a debugger is attached to another process from C#?
body: <p>I have a program that <code>Process.Start()</code> another program, and it shuts it down after N seconds. </p>
  
  <p>Sometimes I choose to attach a debugger to the started program. In those cases, I don't want the process shut down after N seconds.</p>
  
  <p>I'd like the host program to detect if a debugger is attached or not, so it can choose to not shut it down.</p>
  
  <p><strong>Clarification</strong>: I'm not looking to detect if a debugger is attached to <em>my</em> process, I'm looking to detect if a debugger is attached to the process I spawned.</p>