Window Form program crashes unexpectedly, EventType CLR20R3 error Resolution

Source: Internet
Author: User

EventType Clr20r3, P1 ggreadcard.exe, P2 1.0.0.0, P3 51d3d283, P4 Zljy.common, P5 1.0.0.0, P6 4fc6c236, P7, P8, P9 s Ystem.nullreferenceexception, P10 NIL. How to solve it! The solution to the problem is to find out the root of the problem first.

In the development of the WinForm program, using multi-threading, after the server deployment, always automatic shutdown program, the symptoms are described as follows:

in Windows Server 2003 operating system , run. Net 2.0 or 3.5 The system Event Viewer will find similar EventType clr20r3 P1 .... P2 ... Pn

The most likely reason is that the application has an exception, and . NET does not or cannot catch the exception, so the following occurs:

1. The program shuts down automatically.

2. at this point, you will see a DW20.exe process in the Task Manager and will soon disappear automatically .

3. The Event Viewer will find similar EventType clr20r3 P1 .... P2 ... false hint for PN.

 

solution one:. in Config file <configuration>      <runtime>         <legacyunhandledexceptionpolicy Enabled = "true"/>     </runtime></configuration> security , you should find out where to throw the exception and modify it.

Workaround Two:

using the unhandledexceptioneventhandler event, we can intercept the uncaught exception and handle it.

Event arguments for this eventUnhandledExceptionEventArgs E,There are two properties, one isExceptionobject This property tells us whether this exception will cause the application to terminate. What needs to be explained here is, for and  . Net2.0 and above, the situation is not the same, . Net1.1 . Net2.0

        in main form main         

AppDomain.CurrentDomain.UnhandledException +=new < Span style= "color: #2b91af; padding:0px; margin:0px; " >unhandledexceptioneventhandler (Unhandledexceptioneventhandler);

and encode the Unhandledexceptioneventhandler event,

static void Unhandledexceptioneventhandler (object sender, UnhandledExceptionEventArgs e)

{

Try

{

Loghelper.errorlog (e.exceptionobject.tostring ());//loghelper is the class that writes the log, here, can write directly to the file

}

Catch

{

}

}

Run the program, catch the exception, find out where the problem is, and rewrite the code.

www.wonima.com I Nima the world's best-looking jokes picture website

Window Form program crashes unexpectedly, EventType CLR20R3 error Resolution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.