title: COMException: This process has already been attached. (Exception from HRESULT: 0x8013132E)
body: <p>I'm using <code>MdbgProcess</code> and <code>MdbgEngine</code> to write information to an XML file like the application version, process id, time, threads, etc. I have the following code: </p>
  
  <pre><code>MDbgProcess mdbgProcess = null;
      try
      {
          MDbgEngine debugger = new MDbgEngine();
          debugger.Options.StopOnExceptionEnhanced = true;
          mdbgProcess = debugger.Attach(info.ProcessID);
          mdbgProcess.Go().WaitOne();
      }
      catch(Exception e)
      {
  
      }
  </code></pre>
  
  <p>But when I try to execute this line: <code>mdbgProcess = debugger.Attach(info.ProcessID);</code>, I'm getting this exception: <code>COMException: This process has already been attached. (Exception from HRESULT: 0x8013132E)</code>.</p>
  
  <p>Can somebody tell me how to fix this?</p>