Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent debugger from breaking when ArgumentException is thrown when using ValidatesOnExceptions=true in WPF

I am using the ValidatesOnExceptions=true method of WPF validation. This involves throwing an exception in the source's property setter method. It works but the debugger always breaks when the exception is thrown. I am guessing that this is because the exception is not caught directly in my user code but it is caught in the WPF validation code. Is there anyway to stop the behavior, or is it just the price you pay when you use this method of validation?

like image 240
jmatthias Avatar asked Nov 06 '22 07:11

jmatthias


1 Answers

In Visual Studio go to Debug - Exceptions... and uncheck User-unhandled

I think Tools - Options... - Debugging - General - "Enable just my Code" must be checked for this option to be visible

If you want to disable breaking on a specific exception, say System.Exception, then Expand System and uncheck System.Exception

like image 165
Fredrik Hedblad Avatar answered Nov 09 '22 11:11

Fredrik Hedblad