Solution to the "program stopped working" problem.

Source: Internet
Author: User

Solution to the "program stopped working" problem.
Problem

An error occurs when a program cannot be opened,

The problem details are as follows:

Question signature:
Problem event name: CLR20r3
Problem signature 01: rdh-idss.exe
Question signature 02. 0.1.0
Question signature 03: 5510d590
Problem signature 04: RDH-IDSS
Question signature. 0.1.0
Question signature 06: 5510d590
Question signature 07: 92
Question Signature
Question signature 09: System. BadImageFormatException

Solution

1) Baidu has found many similar errors and found that the bullet boxes are always the same, with different details. The key to solving this problem is to check the details. The error "System. BadImageFormatException" is displayed at the end of the detailed information above ".

2) In my program, I added global exception capture, and then I did not play this problem (the error may not affect the whole ). Code:

Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);Application.ThreadException += Application_ThreadException;AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

  

System. BadImageFormatException

Find System. BadImageFormatException in the msdn Library. The cause and solution of this problem are clear.

  • Cause:Compile a later version of the Framework Program with a lower version tool (such as ILDasm.exe or installutil.exe.

    Method:Make the compilation tool correspond to the program version.

  • Cause:Load an unmanaged assembly by loading the managed assembly. For example, Assembly. LoadFile (@ "System32 \ Kernel32.dll ")

    Method:Use the DllImportAttribute method to load an unmanaged assembly.

  • Cause:A dll or executable file is loaded as a 64-bit assembly, but it contains 32-bit features or resources. For example, it relies on COM to interoperate or call methods in the 32-bit dynamic link library.

    Method:Set the "platform target" attribute of the project to x86 (instead of x64 or AnyCPU) and re-compile.

  • Cause:The lower-version Framework Assembly calls the later-version assembly.

    Method:Make sure that the Assembly that causes this exception tries to load the Assembly developed with a compatible version of. NET Framework.

Summary

When you open the program, the system prompts "The program has stopped working". Find the specific error in the details and solve the problem.

 

Related Article

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.