且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何防止Windows应用程序中创建内存转储文件?

更新时间:2023-01-11 18:54:08

为什么?这是Windows的自动调试工具.为什么您要关闭它?

Why? This is an automatic debugging tool that Windows does. Why would you ever want to turn it off?

在您的应用程序中,您可以通过处理所有可能发生的异常来确保应用程序永不崩溃(因此不会生成内存转储).根据您的应用程序类型,您可能必须处理来自不同来源(包括您的条目)的异常 点,任何UI线程以及任何其他应用程序域.当然,您需要确保记录所有这些异常,并至少让用户知道您的应用程序即将终止.但是如果不生成故障转储,您将丢失所有调试信息 您需要诊断客户遇到的问题.

In your app you can ensure that your app never crashes (and therefore won't generate a memory dump) by handling all exceptions that can occur. Depending upon your app type you will likely have to handle exceptions from different sources including your entry point, any UI thread, and any additional app domains. Of course you'll want to ensure you're logging all these exceptions and at least let the user know your app is terminating. But by not generating a crash dump you're going to lose all debug information you need to diagnose problems your customers are having.

我认为这是一个非常糟糕的主意.

This is, in my opinion, a really bad idea.

迈克尔·泰勒
http://www.michaeltaylorp3.net

Michael Taylor
http://www.michaeltaylorp3.net