views:

109

answers:

1

When coding in C# I like not to handle exceptions because it makes it easier to figure out where and why things went wrong. However, I can't give anyone a program that doesn't handle exceptions.

Can I somehow force Visual Studio to break on every exception, including those thrown inside try/catch blocks?

+12  A: 

Go into Debug > Exceptions and check the Thrown box against Common Language Runtime Exceptions.

You may get a lot of noise this way though, as this will also break on exceptions thrown in libraries or inside the framework itself.

itowlson
+1 because I just wanted to say this and you were faster. ;)
Bobby
It's a real shame this isn't the default behaviour.
stusmith
My favourite shortcut, 'ctrl+d e'. Keep in mind those things, they will save you lot of clicking.
Yossarian
If I knew this would be so easy I would have asked this question sooner. This is going to save me a lot of time. Thank you!
hsprogrammer