This is a mistake and is explained here:
OnLoad exception case disappears - user mode callback exceptions in x64
http://blog.paulbetts.org/index.php/2010/07/20/the-case-of-the-disappearing-onload-exception-user-mode-callback-exceptions-in-x64/
VS team response: From here: https://connect.microsoft.com/VisualStudio/feedback/details/357311/silent-exceptions-on-x64-development-machines
Submitted by Microsoft @ 22/04/2010 17:12 Hello
This error was closed as "External" because this behavior is explained by the way the x64 version of Windows handles exceptions. When a user-mode exception crosses the kernel transition, x64 versions of Windows do not allow the exception to propagate. Therefore, attached debuggers are not aware that an exception has occurred, as a result of which the debugger could not break the unhandled exception.
Unfortunately, nothing that the Visual Studio team can do to solve this problem is the result of developing an operating system. All feedback on this should be addressed to the Windows team; however, the Windows team believes that this is the βcorrectβ design of the operating system, and considers the x86 behavior to be βwrong.β
Best regards, Visual Studio Debugger
Solution using Im: Ive placed the code that was inside the form loading constructor, and I check if the application works in the designer or not
protected static bool IsInDesigner { get { return (Assembly.GetEntryAssembly() == null); } } if (!MainForm.IsInDesigner) LoadControl();
source share