RIA Services Domain Data Source Invalid Property Errors
Saturday, June 27, 2009 at 05:29PM 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.
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!
Reader Comments