开发者

How to debug .NET error logged in an Event Viewer?

开发者 https://www.devze.com 2022-12-25 11:02 出处:网络
Hi I found out that my application causes some errors which are logged in an Event log. It states: NET Runtime 2.0 Error

Hi I found out that my application causes some errors which are logged in an Event log.

It states:

NET Runtime 2.0 Error 

    EventType clr20r3, P1 *****.exe, P2 1.0.0.0, P3 4b2a572f, P4 system.web.services, P5 2.0.0.0, P6 4889df18, P开发者_如何转开发7 bc, P8 65, P9 system.net.webexception, P10 NIL.

How can I find out what's going on? I've tried that app locally and everything works fine.


Your app crashed on an unhandled exception. The Watson log won't be good enough to find the cause. Write an event handler for the AppDomain.CurrentDomain.UnhandledException event, have it write e.ExceptionObject.ToString() to the event log so you'll get a good stack trace that shows you why and where it bombed.


Can you describe more about the type of application it is? What it's doing, is it interactive or non-interactive?

The actual error is system.net.webexception - which is some form of problem communicating with a web-page or web-service. This in itself suggests it might an intermittent error if it works fine when you try it.

Either that or something is misconfigured when it's running remotely - something different to your environment. For example, do you use an internal DNS entry that's not available when the application is run remotely?

You will want to catch all exceptions in your application (like an overall try { } catch { } in your main method) and log the exceptions to a file, or get it to e-mail them to yourself, so you can see in more detail what's occuring.


It looks like an unhandled exception. If it's being generated in an web application or service you can try putting an global exception handler in your global.asax file. See here for an example. You can trap the error and output some better information to the event log.


Here is the simple explanation from your event log entry

P4 system.web.services -  module that was throwing the exception 
P9 system.net.webexception  - Exception Type
P8 65 - IL Offset where the exception was thrown

These are Watson bucket for getting the call-stack of the exception. From .NET 2.0 onwards Watson reports have this information.

Here is the MSDN article for above explanation.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号