Workaround for "program has stopped working" issue

Source: Internet
Author: User

Problem

Encountered a program cannot open the error,

The problem details are as follows:

Issue Signature:
Issue Event Name: CLR20R3
Issue Signature 01:rdh-idss.exe
Issue Signature 02:1.0.1.0
Issue Signature 03:5510d590
Issue Signature 04:RDH-IDSS
Issue Signature 05:1.0.1.0
Issue Signature 06:5510d590
Issue Signature 07:92
Issue Signature 08:10
Issue Signature 09:system.badimageformatexception

Solve

1) Baidu find a lot of similar errors, found that the box is always the same, detailed information is not the same. So the key to solving this problem is to see the details. As the last detail in the above details, you can see this error: "System.badimageformatexception".

2) In my program, I added a global exception capture, and then did not play the problem (where possible error does not affect the overall). Code:

Application.setunhandledexceptionmode (unhandledexceptionmode.catchexception); Application.ThreadException + = application_threadexception; AppDomain.CurrentDomain.UnhandledException + = currentdomain_unhandledexception;

  

System.badimageformatexception

Find system.badimageformatexception in the Library of MSDN, where the cause and resolution of the problem is clear.

    • Cause: A low-version compilation tool (such as ILDasm.exe or Installutil.exe) compiles a program with a high-version framework.

      method: make the compilation tool and the program version correspond.

    • Cause: The unmanaged assembly is loaded by the method that loads the managed assembly. such as: Assembly.loadfile (@ "System32\kernel32.dll")

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

    • Reason: A DLL or executable file is loaded as a 64-bit assembly, but it contains 32-bit attributes or resources. For example, it relies on COM interop or calling methods in a 32-bit dynamic-link library.

      method: Set the project's platform target property to x86 (not x64 or AnyCPU) and recompile.

    • Cause: The low-version framework assembly calls the high-version assembly.

      method: Make sure that the assembly that throws the exception tries to load an assembly that is developed with a compatible version of the. NET Framework.

Summarize

To resolve the problem when opening the program, the prompt "program has stopped working" method is to find the specific error in the details and then resolve the related issue.

Workaround for "program has stopped working" issue

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.