I found it was annoying that I would get thrown into the debugger every time a ValidationException was thrown in the Silverlight field validation logic. This can be fixed by telling VS to ignore this particular exception:
VS 2010 already has the ValidationException in the Exceptions list, but if yours doesn’t or you are using VS 2008, you can follow these instructions to manually add it:
- Click on Debug->Exceptions (Ctrl+D, E)
- Click on Add…
- Select the Type as “Common Language Runtime Exceptions”
- Type the name as System.ComponentModel.DataAnnotations.ValidationException and click OK.
- You’ll now see this exception in the list. Uncheck “User-unhandled just for this exception, and click OK.
This lets you keep all of the other exceptions turned on, but Visual Studio will no longer break when Silverlight hits a ValidationException.
No comments:
Post a Comment