In my code, I currently have an exception handling setup which logs exceptions to text files. When I’m debugging the code, however, I’d rather not handle the exceptions and let execution stop rather than read the file, set a breakpoint, etc. Is there an easy way to do this using the Build and Release configurations (something like a preprocessor directive I could use to comment out some of the exception handling code)?
It turns out that there’s a better solution than the original question asked for, see the first answer.
C# does have preprocessor directives (e.g. if, define, etc…) that you could use for this purpose.
However, you could also modify the settings under “Debug -> Exceptions…” in Visual Studio so that the debugger breaks each time an exception is thrown (before execution goes to the catch block).