应用程序在启动时崩溃 - 如何获取故障转储文件?
我的 winform 应用程序一启动就崩溃了。此问题仅发生在其中一台客户端计算机上。适用于所有其他客户。我正在考虑使用 ADPlus 来获取故障转储,但问题是为了在故障模式下配置 ADPlus,需要首先将调试器附加到正在运行的应用程序。这意味着当我配置 ADPlus 时应用程序必须正在运行,但是,正如我所说,我的应用程序一旦启动就会崩溃。它没有给我运行 ADPlus 的机会。您知道 ADPlus 是否可以在这种情况下使用吗?在这种情况下,我可以使用其他工具生成进程转储吗?
My winform application crashes as soon as its been launched. This problem is only happening in one of the client computer. Works fine for all other clients. I was thinking of using ADPlus to get a crash dump but problem is in order to configure ADPlus in crash mode, debugger need to be attached to running application first. That means application must be running when I configure ADPlus, however, as I said my application crashes as soon as I start it. It does not give me a chance to run ADPlus. Any idea if ADPlus can be used in this scenario? Are there any other tools that I can use generate a process dump in this case?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
由于您无法启动程序然后及时附加调试器,因此您可以尝试以下想法之一:
gflags
让 Windows 在调试器下启动程序。 这将为您的程序文件名创建一个子项图像文件执行选项
注册表项下。< /a>如果发生崩溃,调试器将自动中断并自动创建转储或让您手动创建转储。
如果您无法运行调试器,甚至无法运行 ProcDump,您可以使用 Windows 内置的故障转储工具自动创建转储:
在 Windows XP 和 Windows Server 2003 上,将 Dr. Watson 设置为事后调试器:运行此命令:
<前><代码>drwtsn32 -i
以下是有关此命令的作用以及如何使用 Dr. Watson 的信息:捕获应用程序故障转储
在 Windows Vista SP1、Windows Server 2008 和稍后,通过创建以下注册表项将 Windows 错误报告设置为在本地保存转储:
您无需在此项下创建或设置任何值或子项。如果您想更改设置,请参阅以下详细信息:收集用户模式转储
请注意,“WER 不支持执行自己的自定义崩溃报告的应用程序,包括 .NET 应用程序”。这对您来说是个问题,因为您的应用程序使用 WinForms - 尽管有一些迹象表明该功能确实适用于 Windows 7 上的 .NET 4 应用程序。
Since you can't start the program and then attach a debugger in time, you can try one of the following ideas:
gflags
to make Windows start the program under the debugger. This will create a subkey for your program filename under theImage File Execution Options
registry key.If and when the crash happens, the debugger will automatically break in and either create a dump automatically or let you create one manually.
If you can't run a debugger, not even ProcDump, you can use Windows' built-in crash dump facility to create a dump automatically:
On Windows XP and Windows Server 2003, set Dr. Watson as the postmortem debugger by running this command:
Here is info on what this command does and how to use Dr. Watson: Capturing Application Crash Dumps
On Windows Vista SP1, Windows Server 2008, and later, set Windows Error Reporting to save dumps locally by creating this registry key:
You don't need to create or set any values or subkeys under this key. If you want to change settings, here is more info: Collecting User-Mode Dumps
Note that "applications that do their own custom crash reporting, including .NET applications, are not supported by" WER. This is a problem for you because your app uses WinForms - although there is some indication that the feature does work with .NET 4 apps on Windows 7.
您可以使用 Sysinternals 中的 ProcDump 来捕获转储。
You can use ProcDump from Sysinternals to capture a dump.