如何在一个特定的第一次机会异常发生创建.NET程序的转储异常、发生、机会、程序

2023-09-03 11:34:25 作者:提刀杀红眼

我的应用程序在QA环境中抛出InvalidCastException的,这是我不能在发展中重现。

My application throws InvalidCastException in the QA environment, something I cannot reproduce in development.

我希望得到的转储在异常的时刻。我知道ADPlus的,但我不知道如何使用它,这样它会创建转储时引发InvalidCastException。显然,它不区分不同的.NET例外。可能是我错了,有一种方法。或者,还有另外的工具来做到这一点。 preferably免费的。

I wish to obtain the minidump at the exception moment. I know about adplus, but I am not sure how to use it so that it creates the minidump when InvalidCastException is thrown. Apparently, it does not distinguish one .NET exception from another. May be I am wrong and there is a way. Or, there is another tool to do it. Preferably free one.

总之,任何人都可以建议如何处理这个问题呢?

Anyway, can anyone advice how to handle this issue?

感谢。

更新

在构建一个调试版本在这两个QA和开发。然而,QA运行在实验室中得以实现复杂的场景,它的开发者不能重现。在质量保证运行时,因此,我需要的能力,使垃圾场。 我可以修改code和创建code转储。不过,我希望有一个更灵活的解​​决方案,一个不要求每一个这样的问题发生时修改code。

更新2

其实,我已经偷从转储代code约翰罗宾斯SuperAssert.Net再次,这是code从某个具体的点生成转储,而我需要的风格更灵活的方法ADPlus的。 约翰·罗宾斯的方法是创建一个CDB脚本,然后调用CDB调试程序与脚本,使其附加到进程并创建转储。它不利用MiniDumpWriteDump的API。

Actually, I have "stolen" the minidump generation code from John robbins SuperAssert.Net Again, this is code for generating minidump from certain concrete point, whereas I need a more flexible approach in the style of adplus. John Robbins' approach is create a cdb script and then invoke the cdb debugger with that script to make it attach to the process and create the dump. It does not utilize the MiniDumpWriteDump API.

推荐答案

最简单的办法就是让它泡了所有的出路应用程序,让用户将其报告给微软,并报名参加Windows错误报告。

The easiest way is to let it bubble up all the way out of the app, let the user report it to Microsoft, and enroll in Windows Error Reporting.

另外,你可以捕捉它的手用约翰·罗宾斯SUPERASSERT .NET(或他的code的一个子集)。

Alternatively, you can capture it by hand by using John Robbins' SUPERASSERT .NET (or a subset of his code).

更新(适用于非code溶液):看看系统内部机制的 ProcDump 。

UPDATE (for non-code solution): Take a look at Systems Internals' ProcDump.