I've inherited a project that, when started in debug, throws somewhere in the avenue of 8-10k NotImplementedException
s. Because of this, the application takes over a minute to start when debugging... Every. Single. Time.
I talked to the original devs of the project and their solution to the issue is "Just press Ctrl+F5 to start without attaching a debugger". Apart from that being one of the worst solutions to a problem in the history of development, it does work and the application starts immediately. I'm trying to learn this new code-base so just skipping the debugger isn't an option for me.
Obviously I'm aware that no application should start with 10 thousand exceptions, but before I even get to fixing that I have to be able to debug the program.
I would like to suppress or skip first chance exceptions in the same way that starting without the debugger attached does. I've looked at this thread and applied the [DebuggerNonUserCode]
attribute to the related methods but it only prevented the exceptions from being written to the output window. The program still takes over a minute to start up. Is this possible?
Edit:
I forgot to mention, I don't have anything checked in the Debug->Exceptions window. Also, all of the exceptions are wrapped in Try.. Catch
statements
Crappy workaround: In the part of the code which is past all exceptions, where you want to start debugging, put the following lines
System.Diagnostics.Debugger.Launch();
System.Diagnostics.Debugger.Break();
You can then start Ctrl+F5, and then be prompted to attach debugger when it hits that point in the code.