Suppressing ValidationException During Debugging
Validation for Silverlight .NET RIA Services throws a ValidationException if during validation it detects invalid data.
When your debugging this can cause your debugger to break on the property setter each time a validation error occurs.
After 5 or 6 times of getting that exception and having to switch over and continue will drive you crazy. Yes, Microsoft is aware that throwing an exception for validation isn’t the best plan, but currently that’s the only option for Silverlight.
You can turn off breaking on this unhandled exception by adding the type to the list of exceptions and unchecking breaking on user-unhandled exceptions of that type.
Go to the Debug – > Exceptions menu item and click the Add… button on the right side In the Type select “Common Language Runtime Exceptions” and input System.ComponentModel.DataAnnotations.ValidationException in the Name field.
After you click OK – you should now see it show up in the list as you do below.
Uncheck the far right check box “User-Unhandled” and it should look like the following
Now simply click “OK” to save the change and go back to your debugging without the interruptions!
Reader Comments