问题描述
在生产服务器上,当ASP.NET应用程序崩溃时,我可以从系统事件查看器中看到此事件:
On the production server, I can see this event from system Event Viewer when an ASP .NET app crashes:
它属于.NET Runtime 2.0错误报告类别。
It belongs to ".NET Runtime 2.0 Error Reporting" category.
但是我找不到属于ASP.NET 2.0.50727.0类别的事件,它可以给我这个异常一个详细的视图,例如:
But I can't find an event which belongs to "ASP.NET 2.0.50727.0" category which can give me this exception a detailed view like this:
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
我的dev机器上有第二个事件,是因为Visual Studio安装在那里?
I have the second event on my dev machine, is it because Visual Studio is installed there? If so, how can I disable this so I can emulate the production environment?
推荐答案
有时候,您可能会看到这个可怕的错误。 Windows事件日志:
Sometimes you may see this scary error in the Windows Event Log:
正如你所看到的,没有堆栈跟踪,并且您不知道P1,...,P10和任何数字。你知道最糟糕的部分是什么;唯一的事情,让你不睡觉,让你希望,如果它不是在日志,是的! dp.ui消息。
As you can see it is unclear and has no stack trace, and you don’t have any idea about P1, …, P10 and any numbers. You know which the worst part of that is; the only thing that make you not to sleep and make you wish if it wasn’t in the log, yes! The "dp.ui" message.
确定,除了所有的笑话和祝愿,当发生无限循环或方法调用时,会引发system.stackoverflowexception,因此您应该检查所有源的任何递归方法调用,您可以启动Visual Studi来调试。但它是不可能和可行的,所有的时间,即使你的应用程序不是企业。所以你必须谷歌P1,...,P10。
OK, besides of all jokes and wishes, the exception "system.stackoverflowexception" is raised when an infinite loop or method calling happen, so you should check all sources for any recursive method calling and you could fire up Visual Studi to debug that. But it is not possible and feasible all the time even if your application is not enterprise. So you have to google for P1, ..., P10. I did it instead of you, so just sit back and relax!
P1 :发生此错误的应用程式名称
P2 :应用程式版本
P3 :应用程式时间戳记
P4 :装配/模块名称
P5 :装配/模块版本
P6 :装配/模块时间戳记
P7 :MethodDef
P8 :IL偏移量
P9 :异常名称名称过长)
P1: application name that has occurred this error
P2: application version
P3: application time stamp
P4: Assembly/Module name
P5: Assembly/Module version
P6: Assembly/Module timestamp
P7: MethodDef
P8: IL offset
P9: exception name (hashed because the name is too long)
很显然,我们需要找到P7,P8。
It’s pretty obvious that we need to find P7, P8. IL Disassembler, a tool included in Visual Studio, will help us to do that.
- 执行IL Disassembler并打开您的库。
- Execute IL Disassembler, and open your library.
- Menu: view -> MetaInfo -> Show!, pay much attention to the check list of the menu, especialy Raw check boxes.
- A dialogue box will appear, search for combination
06000
with62e
and you will see the MethodName of the class and by looking up you will see the first TypeDef which declare the class. And that's all!
当你去你的应用程序,你可能会看到一个递归调用,你应该检查使这个循环退出的条件!
As you go to your application you may see a recursive calling and you should check the condition that makes this loop exit!
在Windows和服务应用程序中,此异常可能喜欢以下内容,您应该通过IL Disassembler检查sib.infobase.workflow.services.exe p>
In windows and service application this exception maybe likes the following and you should check "sib.infobase.workflow.services.exe" by "IL Disassembler":
如果你在网上冲浪,准备:
,但可能无法正常处理此异常。
If you surf in the net you may see a solution like Microsoft has prepared: http://support.microsoft.com/kb/911816 , but it may be don’t work properly for this exception.
- http://www.netframeworkdev.com/common-language-runtime/clr20r3-from-a-windows-service-calling-a-dot-net-dll-32830.shtml
- http://social.msdn.microsoft.com/Forums/en-US/netfxtoolsdev/thread/ec36eff9-ac9f-46da-afa1-92be489d6a56
这篇关于未处理的异常,导致应用程序与“EventType clr20r3,P1 w3wp.exe”崩溃在日志中,但没有细节的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!