CslaDataProvider ArgumentNullException in Silverlight

CslaDataProvider ArgumentNullException in Silverlight

Old forum URL: forums.lhotka.net/forums/t/8793.aspx


Dane posted on Monday, April 12, 2010

I'm getting an ArgumentNullException which is telling me that the argument for Method is null when using the CslaDataProvider in a Silverlight application.  This looks for all the world like the system is unable to resolve the type specified by the ObjectType property of the CslaDataProvider.   I've verified that the ObjectType is being set in the page's xaml to the AssemblyQualifiedName for the type I wish to use and that the FactoryMethod is set to the correct static method name on that type.  The Silverlight code provides a public constructor for the class and I've verified that the AssemblyQualifiedName for the type is identical in both Silverlight and .NET.  I'm obviously missing something but I'm not sure what to try next.  Any suggestions will be appreciated.

Thanks

sergeyb replied on Monday, April 12, 2010

Maybe parameter(s) are not correct?  Or factory method is not pubic?  You can always build CSLA on your machine in Debug mode and set a breakpoint in provider's Refresh method to see what is null.

Dane replied on Monday, April 12, 2010

At the point I call Refresh on the data provider the factory method name is correct and the parameters are valid.  The specified factory method has a public static void signature.  The stack trace is showing the exception occurs at System.Delegate.CreateDelegate which seems to indicate either an instance of the class is failing instantiation or the method is not valid.  Since I put a break point on the public constructor for the class and that point is never being hit it makes me think the former is the issue.

Dane replied on Tuesday, April 13, 2010

I'm using the 4.0.0 preview 2 binaries from the debug folder.  Is it possible this is the issue?  I am unable to step into the data provider's Refresh method so I have no good way to get at the source of the issue.

sergeyb replied on Tuesday, April 13, 2010

I think you will need to download source code and build so that you can debug it..

 

Sergey

RockfordLhotka replied on Tuesday, April 13, 2010

And you might get the more recent msi-based setup I linked to from a post last week - the Preview 2 is now quite old, and the msi includes much newer code.

Dane replied on Tuesday, April 13, 2010

Will do.  I saw that but, since it didn't appear in the downloads area, I wasn't sure if it was just the same code or not.

RockfordLhotka replied on Tuesday, April 13, 2010

I wasn't sure how well the msi would work (or be recieved) so I did a more limited release just through the forum post :)

Dane replied on Monday, April 19, 2010

This appears to have been an issue with 4.0.0 preview 2.  I upgraged to preview 4 and this problem went away.

BTW I really like the new rules system.  It was a major pain to update everything but the new rules system provides a tremendous amount of flexibility.

Copyright (c) Marimer LLC