asp.net - 导致应用程序崩溃的未处理异常,日志中显示 "EventType clr20r3, P1 w3wp.exe",但没有详细信息

标签 asp.net .net windows crash

在生产服务器上,当 ASP .NET 应用程序崩溃时,我可以从系统事件查看器中看到此事件:

EventType clr20r3, P1 w3wp.exe, P2 6.0.3790.3959, P3 45d691cc,
P4 app_web_default.aspx.cdcab7d2, P5 0.0.0.0, P6 4b2e4bf0, P7 4, P8 4, P9
system.dividebyzeroexception, P10 NIL.*

它属于“.NET Runtime 2.0 错误报告”类别。

但是我找不到属于“ASP.NET 2.0.50727.0”类别的事件可以给我这个异常的详细 View ,如下所示:

An unhandled exception occurred and the process was terminated.  
Application ID: /LM/W3SVC/505951206/Root  
Process ID: 1112  
Exception: System.DivideByZeroException  
Message: Attempted to divide by zero.  
StackTrace:    
   at _Default.Foo(Object state)  
   at System.Threading.ExecutionContext.runTryCode(Object userData)  
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)  
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)  
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(_ThreadPoolWaitCallback tpWaitCallBack)  
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state)  
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp

我的开发机器上有第二个事件,是因为那里安装了 Visual Studio 吗?如果是这样,我该如何禁用它以便模拟生产环境?

最佳答案

有时您可能会在 Windows 事件日志中看到这个可怕的错误:

EventType clr20r3, P1 w3wp.exe, P2 6.0.3790.3959, P3 45d6968e, P4 dp.ui, P5 3.9.7.55, P6 4b49a307, P7 62e, P8 0, P9 system.stackoverflowexception, P10 NIL.

如您所见,它不清楚并且没有堆栈跟踪,您对 P1、...、P10 和任何数字一无所知。您知道其中最糟糕的部分是什么;唯一让你睡不着的东西,如果它不在日志中,会让你希望,是的! “dp.ui”消息。

原因

好吧,除了所有的笑话和愿望之外,当发生无限循环或方法调用时会引发异常“system.stackoverflowexception”,因此您应该检查所有源代码以查找任何递归方法调用,然后您可以启动 Visual Studi 进行调试那。但即使您的应用程序不是企业应用程序,也不可能始终可行。所以你必须用谷歌搜索 P1,...,P10。我代替你做的,所以请高枕无忧!

P1:发生此错误的应用名称
P2:应用版本
P3:应用时间戳
P4:程序集/模块名称
P5:组装/模块版本
P6:组装/模块时间戳
P7:方法定义
P8:IL偏移量
P9:异常名(因为名字太长,散列了)

决议

很明显,我们需要找到 P7、P8。 Visual Studio 中包含的工具 IL Disassembler 将帮助我们做到这一点。

  1. 执行 IL 反汇编程序,并打开您的库。
  2. 菜单:view -> MetaInfo -> Show!,注意菜单的复选框,尤其是Raw复选框。
  3. 将出现一个对话框,搜索 0600062e 的组合,您将看到该类的 MethodName,通过查找您将看到第一个声明的 TypeDef类。就这样!

当您转到您的应用程序时,您可能会看到一个递归调用,您应该检查使该循环退出的条件!

在 Windows 和服务应用程序中,此异常可能类似于以下内容,您应该通过“IL Disassembler”检查“sib.infobase.workflow.services.exe”:

EventType clr20r3, P1 sib.infobase.workflow.services, P2 1.0.2740.20114, P3 468a74f5, P4 sbpscs, P5 1.0.2740.20087, P6 468a74be, P7 1c, P8 120, P9 zxkyzcs5wacordmkttdkr1xouosi00fr, P10 NIL.

如果您在网上冲浪,您可能会看到 Microsoft 准备的解决方案: http://support.microsoft.com/kb/911816 , 但对于此异常可能无法正常工作。

更多信息

Finding method for error-reporting bucket parameters

关于asp.net - 导致应用程序崩溃的未处理异常,日志中显示 "EventType clr20r3, P1 w3wp.exe",但没有详细信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1937931/

相关文章:

javascript - 在 Internet Explorer 上,未将对象引用设置为 AngularJS 中的对象实例

javascript - 使用 JavaScript 设置的值不会保留在回发中

c# - 无法使用删除命令

.net - 最佳实践 : Unit Test structuring

.net - 如何将.Net应用程序部署到heroku

c# - 为什么 visual studio 不添加链式引用?

c# - 表单运行时不显示上下文菜单项

javascript - ASP.NET 隐藏字段在回发后不更新

c# - 如何在 WebPartZone 中加载 highchart 脚本

php - APC for windows 替代下载