Home > Backend Development > C++ > Why Doesn't VS2010 Show Unhandled Exception Messages in 64-bit WinForms Apps?

Why Doesn't VS2010 Show Unhandled Exception Messages in 64-bit WinForms Apps?

Susan Sarandon
Release: 2025-02-01 22:01:09
Original
540 people have browsed it

VS2010 64 -bit WinForms application has not displayed unprocessed abnormal messages: a problem

When using C#and .NET Framework 4 to create a new Windows Forms application in VS2010, users encountered an unusual behavior about unprocessed abnormalities. After adding a specific code to the Form1_LOAD processing program, it is expected that the unproofed unusual message in a certain line is not displayed. On the contrary, the code execution has no error, and the application continues to run.

This special behavior is attributed to the method of interacting with 64 -bit Windows 7 through the WOW64 analog layer. The problem is that this layer intercept the abnormality of the code generated by the notification generated by the 64 -bit window manager. As a result, the debugger could not identify and enter the exception.

In order to solve this problem, several solutions were proposed:

Set the platform target as AnyCPU and cancel the selected "Prefer 32 -bit"

This method has changed the application to the 64 -bit process, eliminating the WOW64 simulation layer and its related abnormal problems. However, it may affect the "editing and continue" function, and it may not be feasible to rely on 32 -bit code.

Other solutions

In "Debug" & GT; "Odoma", the CLR abnormally enables the "throwing" check box, and the compulsory debugger stops the abnormal code line.
  • The Try/Catch block with Fairfast processing in the LOAD event processing program.
  • Set
  • in the main () to disable abnormal capture in the debug mode.
  • Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException) Re -evaluate the necessity of code in the LOAD event processing program, and consider using an alternative event processing program or a constructor to place appropriate code.
  • Upgrade to Windows 8 or higher, of which the WOW64 problem has been solved.

The above is the detailed content of Why Doesn't VS2010 Show Unhandled Exception Messages in 64-bit WinForms Apps?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template