如何转储.NET进程,以便Visual Studio 2008将其作为托管转储加载? [英] How do I dump the .NET process so that Visual Studio 2008 will load it as a managed dump?

查看:230
本文介绍了如何转储.NET进程,以便Visual Studio 2008将其作为托管转储加载?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个管理进程的minidump,它可以加载到Visual Studio 2008中。我使用以下代码来创建一个minidump:

I'm trying to create a minidump of the managed process, which would be loadable into Visual Studio 2008. I'm using following code to create a minidump:

...
MINIDUMP_TYPE dumpType =  static_cast< MINIDUMP_TYPE >(
  MiniDumpWithFullMemory |  MiniDumpWithDataSegs | MiniDumpWithHandleData |
  MiniDumpWithProcessThreadData | MiniDumpWithPrivateReadWriteMemory );
BOOL bSuccess = MiniDumpWriteDump(
  hProcess, dwProcessID, hFile, dumpType, NULL, NULL, NULL );
...

我尝试了很多MINIDUMP_TYPE的其他组合,但没有收到我我想要的:能够将转储文件加载到Visual Studio中,以便在附加到进程时显示托管代码。转储文件正在加载,我可以将其用作本机代码。但是当我尝试调试它作为托管代码( http://vvcap.net/db/gkqmlA9qbQIK47 -patap.htp ),我收到以下错误:指定的文件是无法识别或不受支持的二进制格式( http://vvcap.net/db/lw5cEvSMl3yiiHRkt87R.htp

I tried a lot of other combinations of MINIDUMP_TYPE, but none yielded me what I wanted: to be able to load dump file into Visual Studio, so that a managed code shows up, the way it does when you "attach to process". Dump file is getting loaded and I can use it as a native code. But when I try to debug it as managed code ( http://vvcap.net/db/gkqmlA9qbQIK47-patap.htp ), I'm receiving following error: "The specified file is an unrecognized or unsupported binary format" ( http://vvcap.net/db/lw5cEvSMl3yiiHRkt87R.htp )

推荐答案

管理转储调试不是Visual Studio 2008的支持功能。至少将其调试为托管代码不是。您可以在有限的范围内对此类型的文件使用WinDbg。

Managed dump debugging is not a supported feature of Visual Studio 2008. At least debugging it as managed code is not. You can use WinDbg to a limited extent for this type of file.

这篇关于如何转储.NET进程,以便Visual Studio 2008将其作为托管转储加载?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆