Generating .NET crash dumps automatically

后端 未结 7 2227
清酒与你
清酒与你 2020-11-28 06:57

I know how to generate Crash Dump files with ADPlus or DebugDiag, but I\'m wondering if there is a way to do this on a customer\'s computer without installing these tools...

7条回答
  •  一生所求
    2020-11-28 07:09

    Note that creating a minidump from inside the "failing" process (or even thread) itself is not trivial or might not be accurate (also MiniDumpWriteDump function's Remarks).

    Besides, if your process is in such anger that you might need to write a crash dump, the whole situation is typically so hosed, that even attempting to create a crash dump could cause another crash (situations like hangs aside - but those might be even harder to "catch" from within the current process).

    The "best" thing you can do, if you cannot install separate applications on your client's systems, is to start an external process (which could also fail in critical situations!) and let that create a crashdump from your current process (see Superassert.NET from John Robbins). You could even go so far, as to put the external binary into your app resources, extract it from there on startup (as to minimize failure in critical situtations) to disk (if you dare).

提交回复
热议问题