C#崩溃转储不存在
我有一个 C# 应用程序,有时会因未知原因崩溃。因此,我想找到故障转储文件,但它不存在。我还编写了一个小应用程序,它会引发 DivideByZero
异常(未处理)。这样做的后果是:在一个系统上,程序关闭时没有任何消息,而在另一个系统(VM)上,我收到一个简单的崩溃报告,想要将数据发送给 Microsoft。
我配置了 drwtsn.exe
和注册表设置。我也尝试使用 WinDbg
但没有成功。
有人知道如何强制系统写入转储文件吗?
此致, 埃尔
I have a C# application which crashes sometimes for unknown reason. Therefore, I want to find the crash dump file but it does not exist. I also wrote a small application which provokes a DivideByZero
exception (unhandled). The consequences of this: on the one system the program closes without any message, on the other system (VM) I get a simple crash report which wants to send data to Microsoft.
I configured drwtsn.exe
and the registry settings. I also tried to use WinDbg
without success.
Does anybody know how I can force the system to write dump files?
Best regards,
el
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要为 AppDomain.UnhandledException 事件编写一个事件处理程序。记录 e.ExceptionObject.ToString() 值几乎总是足够好的,堆栈跟踪会告诉您代码是如何陷入困境的。
从 dbghelp.dll 中 P/Invoking MiniDumpWriteDump() 也是可能的,您将获得一个 .dmp 文件,您可以使用该文件通过 WinDbug 分析异常。 Dbghelp.dll 在 Vista 和 Win7 上可用,您可以从调试工具获取它对于 Windows 下载早期版本。但是,在 VS2010 发布之前,您无法从该小型转储中获得良好的托管堆栈跟踪。
You'll need to write an event handler for the AppDomain.UnhandledException event. Logging the e.ExceptionObject.ToString() value is almost always good enough, the stack trace tells you how the code got into trouble.
P/Invoking MiniDumpWriteDump() from dbghelp.dll is possible too, you'd get a .dmp file that you could use to analyze the exception with WinDbug. Dbghelp.dll is available on Vista and Win7, you can get it from the Debugging Tools for Windows download for earlier versions. However, you can't get good managed stack traces from that minidump, not until VS2010 ships.
ADPlus 是最简单的方法。详细文档从这里开始:http://support.microsoft.com/kb/286350
ADPlus is the easiest way. Extensive documentation starts here: http://support.microsoft.com/kb/286350