生成.NET崩溃转储自动

编程入门 行业动态 更新时间:2024-10-26 06:28:48
本文介绍了生成.NET崩溃转储自动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我知道如何生成故障转储文件ADPlus的或DebugDiag资料,但我不知道是否有办法做到这一点客户的计算机上没有安装这些工具......特别是,我想能够配置我的应用程序(使用注册表值,例如)来产生严重故障的情况下崩溃转储。更具体地讲,我需要能够从C#应用程序做到这一点,但我不介意P / Invoke'ing如果必要的。谢谢!

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... specifically, I would like to be able to configure my application (using a registry value, for example) to generate a crash dump in the case of a critical failure. More specifically, I need to be able to do this from a C# application, but I don't mind P/Invoke'ing if necessary. Thanks!

推荐答案

请注意,从里面的失败的过程创建转储(甚至线程)本身是不平凡的,也可能是不准确的(也的 MiniDumpWriteDump 功能的备注)。

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).

最好的事情你可以做,如果你不能安装到客户端的系统独立的应用程序,是启动一个外部进程(也可以在紧急情况下失败!),并让这从当前进程创建一个故障转储(看 Superassert.NET从约翰·罗宾斯)。你甚至可以走那么远,才能把外部的二进制到您的应用程序资源,从那里提取它在启动时(以最大限度地节省关键situtations失败)磁盘(如果你敢)。

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).

更多推荐

生成.NET崩溃转储自动

本文发布于:2023-10-20 03:34:49,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1509722.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:NET

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!