【发布时间】:2013-02-14 14:38:24
【问题描述】:
我正在使用 MDbg 检索在进程的应用程序域中列出的所有程序集的列表。每当我尝试将进程附加到 MDbgEngine 时,我都会收到以下异常消息:
调试器的协议与被调试者不兼容。 (HRESULT 异常:0x8013134B)
我是否遗漏了某些内容或错误地调用了该方法?我正在使用 .NET Framework 4.0,MDbg 核心参考取自 \Microsoft SDKs\Windows\v7.0A\Bin\MdbgCore.dll。
代码:
MDbgProcess process;
MDbgEngine mDbgEngine = new MDbgEngine();
process = mDbgEngine.Attach(myProcess.Id); // this line causes the error
foreach (CorAppDomain appDomain in process.AppDomains)
{
foreach (CorAssembly assembly in appDomain.Assemblies)
{
//get assembly information
}
}
【问题讨论】:
-
可能你使用的是 .NET 2 版本的 MDbg 或者位数错误。
-
MDbg 需要一段时间才能支持 .NET 4 调试器协议版本,它不会在 SDK 版本 7 中实现。我已经为您提供了版本 4 示例的链接。
-
@Matthew 较早的帖子,但与我的需求类似。由于您的帖子和 Hans Passant 的提示,我同时解决了这个问题。如果您仍然需要它,这是我的帖子:stackoverflow.com/questions/40803406/…