Search
More About This Website

All information is provided "AS IS" with no warranties, and confers no rights

Login
« Snapshot of the Silverlight 4 Wish list | Main | First look at Bing.com »
Saturday
Jun272009

RIA Services Domain Data Source Invalid Property Errors

Silverlight 3 has made it a little easier to pin point these types of errors but it can still be complex at times.  One of those times is when the invalid property is on the DomainContext of your .NET RIA Services DomainDataSource control.  You might see it getting this type of AG_E_PARSER_BAD_PROPERTY_VALUE exception. 

image 

If taking the line number to the XAML file along with the position indicates it’s the DomainContext property that’s where it gets interesting.  I’ve been caught in this trap a few times as I scratch my head trying to figure out why it thinks DomainContext is invalid when I know for sure it is a valid property.  Unfortunately, there’s not an inner exception that you can get more details from so you are kind of stuck! So how do you get more info? 

The quickest way I have  found is simply remove the DomainContext property and set it via the code behind with some quick temporary code.  Then when you run the code in the debugger you will still get the exception but now will get a much clearer message typically than you got before.  In this case I was simply looking for a method that wasn’t exposed so the fix was easy now that I found the problem!

image

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>