COMException: This process has already been attached. (Exception from HRESULT: 0x8013132E)

1

I'm using MdbgProcess and MdbgEngine to write information to an XML file like the application version, process id, time, threads, etc. I have the following code:

MDbgProcess mdbgProcess = null;
    try
    {
        MDbgEngine debugger = new MDbgEngine();
        debugger.Options.StopOnExceptionEnhanced = true;
        mdbgProcess = debugger.Attach(info.ProcessID);
        mdbgProcess.Go().WaitOne();
    }
    catch(Exception e)
    {

    }

But when I try to execute this line: mdbgProcess = debugger.Attach(info.ProcessID);, I'm getting this exception: COMException: This process has already been attached. (Exception from HRESULT: 0x8013132E).

Can somebody tell me how to fix this?

c#
debugging
asked on Stack Overflow Jun 11, 2015 by jmc

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0