Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6639937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:36:49+00:00 2026-05-25T23:36:49+00:00

Ive put my initialization code at form load, since it is not a good

  • 0

Ive put my initialization code at form load, since it is not a good idea to leave it at the constructor because the designer can crash.

The problem is that Ive just realized that any exception inside the form load event will be catch internally!

Why? How should I overcome that?

    private void Form1_Load(object sender, EventArgs e)
    {
        //This exception will be catch internally (I don't know why and where)
        throw new Exception("test");
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T23:36:49+00:00Added an answer on May 25, 2026 at 11:36 pm

    It is a bug and is explained here:

    The case of the disappearing OnLoad exception – 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 answer:
    From here: https://connect.microsoft.com/VisualStudio/feedback/details/357311/silent-exceptions-on-x64-development-machines

    Posted by Microsoft @ 22/04/2010 17:12
    Hello,

    This bug was closed as "External" because this behavior results from how x64 version of Windows handle exceptions. When a user mode exception crosses a kernel transition, x64 versions of Windows do not allow the exception to propagate. Therefore attached debuggers are unaware of the fact that an exception occurred resulting in the debugger failing to break on the unhandled exception.

    Unfortunately where is nothing that the Visual Studio team can do to address this, it is the result of operating system design. All feedback regarding this issue should be addressed to the Windows team; however the Windows team considers this to be the "correct" operating system design, and considers the x86 behavior to be "incorrect".

    Best Regards,
    Visual Studio Debugger


    Solution that Im using:
    Ive put the code that was inside the form load to the constructor and I check if the app is running in designer or not

        protected static bool IsInDesigner
        {
            get { return (Assembly.GetEntryAssembly() == null); }
        }
    
         if (!MainForm.IsInDesigner)
              LoadControl();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ive built a form that I need to post back on. I have put...
I've put together a simple form to highlight the concepts of dynamic forms. What
I've put together a small code-sample below (Currently in C# 3.5 but would also
I'm using Smarty templates which call object methods. I've put the code on a
I need a place to run an initialization code that is application specific (like
I'm going to try and explain this without showing any code because I don't
Ive put in a custom Back UIBarButtonItem, which is from an Image i made
Ive added a uiimageview as a subview to my cell.and then put a label
I've put an instance of the client proxy for the WCF service into a
I've put together a pretty simple competition script - it's commented out below and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.