在 Windows 事件查看器中诊断 CLR 错误
我们有一个 .NET 桌面应用程序在生产中崩溃了。 我们如何诊断错误? 我想知道发生的异常类型、错误消息和堆栈跟踪。
由于我们的代码未处理该异常,因此我们收到了“此应用程序遇到问题并需要关闭”Windows 消息框。 唯一的选择就是关闭,没有调试按钮。
这篇 MSDN 文章 建议查看 Windows 事件注册表。 我查了一下,里面的信息如下:
应用程序 Initect.Server.UI.exe 出现故障, 版本0.12.9084.90, 时间戳 0x49cac472, 错误模块 KERNEL32.dll, 版本6.0.6001.18000, 时间戳0x4791a81d, 异常代码0xe0434f4d, 故障偏移0x0002f35f, 进程ID 0x44c, 应用程序启动时间0x01c9ada7f320cab0
这些信息如何告诉我异常类型、堆栈跟踪和错误消息?
We have an .NET desktop application that crashed in production. How do we diagnose the error? I'd like to know the type of exception that occurred, the error message, and the stack trace.
Because the exception wasn't handled by our code, we received the "This application has encountered a problem and needs to close" Windows message box. The only option was to close, there was no debug button.
This MSDN article suggested looking in the Windows Event registry. I checked there, and here's the information inside it:
Faulting application Initect.Server.UI.exe,
version 0.12.9084.90,
time stamp 0x49cac472,
faulting module KERNEL32.dll,
version 6.0.6001.18000,
time stamp 0x4791a81d,
exception code 0xe0434f4d,
fault offset 0x0002f35f,
process id 0x44c,
application start time 0x01c9ada7f320cab0
How can this information tell me the exception type, the stack trace, and the error message?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这些信息不足以让您获得堆栈跟踪、异常类型、错误消息等。
您可以在 Windows Server 2008 上配置 Windows 错误报告(向您显示问题并需要关闭 UI)以始终收集转储文件然后您就可以进行调试。 这不需要您在生产环境中安装 Visual Studio 或任何其他调试器。
http://blogs.technet。 com/askperf/archive/2008/02/05/ws2008-windows-error-reporting.aspx 显示执行此操作的正确注册表设置。
That information isn't enough to get you a stack trace, exception type, error message, etc.
You can configure Windows Error Reporting (which showed you the problem & needs to close UI) on Windows Server 2008 to always collect a dump file that you can then debug. This doesn't require you to install Visual Studio or any other debugger in your production environment.
http://blogs.technet.com/askperf/archive/2008/02/05/ws2008-windows-error-reporting.aspx shows the proper registry settings to do this.