I am using Visual Studio 2019 with .NET Framework 4.6.1.
If I do the following:
- Make a new project using the 'Windows Form App (.NET Framework)' template.
- Select the .NET Framework 4.6.1. Later exploration has found that 4.7.2. will also suffice.
- Open up the newly created Form1 in design view.
- In Form1, use the GUI to add a Month Calendar.
- Set my Exception Settings to break on any exception.
- Run the program.
Then I always get a System.ArgumentException from Application.Run(new Form1()); reporting that "Value does not fall within the expected range". When you look very closely at the call stack, you will see that the true source of the error is from System.Windows.Forms.dll!System.Windows.Forms.AccessibleObject.Accessibility.IAccessible.get_accChild(object ChildID). Once this exception has been thrown, your debugger will be stuck re-throwing it eternally.
Are there any simple fixes for this? Wrapping the source of the exception in a try/catch block does not stop the debugger from breaking. I can tell the debugger to ignore exceptions of this type from System.Windows.Forms.dll, but ignoring the problem is not a solution to it.