简体   繁体   English

如何转储.NET进程,以便Visual Studio 2008将其作为托管转储加载?

[英]How do I dump the .NET process so that Visual Studio 2008 will load it as a managed dump?

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: 我正在尝试创建一个托管过程的小型转储,可以将其加载到Visual Studio 2008中。我正在使用以下代码来创建小型转储:

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

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". 我尝试了许多其他MINIDUMP_TYPE组合,但没有一个让我满意:能够将转储文件加载到Visual Studio中,以便显示托管代码,即“附加到进程”时的方式。 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 ) 但是,当我尝试将其调试为托管代码( http://vvcap.net/db/gkqmlA9qbQIK47-patap.htp )时,出现以下错误:“指定的文件是无法识别或不受支持的二进制格式”( http: //vvcap.net/db/lw5cEvSMl3yiiHRkt87R.htp

Managed dump debugging is not a supported feature of Visual Studio 2008. At least debugging it as managed code is not. Visual Studio 2008不支持托管转储调试。至少不能调试托管代码。 You can use WinDbg to a limited extent for this type of file. 对于这种类型的文件,可以在有限的范围内使用WinDbg。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM