Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 无法使用mdbg从进程分离_C#_.net_Debugging_Mdbg - Fatal编程技术网

C# 无法使用mdbg从进程分离

C# 无法使用mdbg从进程分离,c#,.net,debugging,mdbg,C#,.net,Debugging,Mdbg,接下来,我现在有了可以使用MDBGAPI附加到进程的代码 问题是,如果需要,我无法从流程中分离。当我打电话时 mgProcess.Detach().WaitOne()(其中mgProcess是从MDbgEngine对象创建的MDbgProcess)我收到以下错误消息: Process not synchronized. (Exception from HRESULT: 0x80131302) at Microsoft.Samples.Debugging.CorDebug.Native

接下来,我现在有了可以使用MDBGAPI附加到进程的代码

问题是,如果需要,我无法从流程中分离。当我打电话时 mgProcess.Detach().WaitOne()(其中mgProcess是从MDbgEngine对象创建的MDbgProcess)我收到以下错误消息:

 Process not synchronized. (Exception from HRESULT: 0x80131302)
     at Microsoft.Samples.Debugging.CorDebug.NativeApi.ICorDebugController.Detach()
     at Microsoft.Samples.Debugging.CorDebug.CorController.Detach() in C:\mdbg\src\debugger\corapi\Controller.cs:line 89
     at Microsoft.Samples.Debugging.MdbgEngine.MDbgProcess.Detach() in C:\mdbg\src\debugger\mdbgeng\Process.cs:line 716
如果我只是尝试调用mgProcess.Detach()mgProcess.CorProcess.Detach()我会得到相同的结果


有人知道分离Mdbg进程的正确方法吗?

据了解,Mdbg不允许您执行任何操作

似乎是前进的方向。

尝试以下方法:

proc.AsyncStop();
proc.Detach();

proc.AsyncStop();
proc.Detach();
Proc.CorProcess.Stop(0);  
Proc.Detach();