Silverlight Feeds - All your Silverlight feeds in one place.

Sponsors

Saturday, August 08, 2009

Not Breaking on ValidationException (take 2)

by Jeff Handley via Jeff Handley on 8/8/2009 2:44:39 AM

Awhile back, I blogged about how Silverlight uses Validation Exceptions, which can cause the debugger to break.  I showed how to prevent that from happening, but the solution was less than ideal.

Someone named rlodina commented on the post:

What about manual adding:
System.ComponentModel.DataAnnotation.ValidationException
in this list.

This comment has been sitting in my inbox for about a week, and I had wanted to follow up on this.  Well good gosh, this is easy and it works like a charm.  You can in fact tell VS to only ignore ValidationException instances, while still breaking on everything else.  Here’s how.

  1. Click on Debug->Exceptions (Ctrl+D, E for your keyboard folks)
  2. Click on Add…
  3. Select the Type as “Common Language Runtime Exceptions”
  4. Type the name as System.ComponentModel.DataAnnotations.ValidationException and click OK.
  5. You’ll now see this exception in the list.  Uncheck “User-unhandled just for this exception, and click OK.

image

This lets you keep all of the other exceptions turned on, but Visual Studio will no longer break when Silverlight hits a ValidationException.  Like I said, it works like a charm.  Thanks rlodina! :-)

Technorati Tags: ,
email it!bookmark it!digg it!

Original Post: Not Breaking on ValidationException (take 2)

Subscribe

New Feed

Product Spotlight

Recently Updated Sources

Legal Note

The content of the postings is owned by the respective author. Silverlight Feeds is not responsible for the contents of the postings. This site is automatically generated and cannot be reviewed for abusive content. If you find abusive content on Silverlight Feeds, please contact us. Designated trademarks and brands are the property of their respective owners. All rights reserved.

Advertise with us