MembershipIdentity and Silverlight

MembershipIdentity and Silverlight

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


dnwheeler posted on Thursday, November 13, 2008

I'm trying to get MembershipIdentity working with a Silverlight app and am having a few problems.

I started with the MyPrincipal.cs and MyIdentity.cs files from the membership test app. I then added a BeginLogin method to MyPrincipal to handle the login asynchronously. I've also added the necessary #if SILVERLIGHT conditionals. The code builds fine, but when I try to log in, I get an exception: "No parameterless constructor defined for this object."

I've tried adding public parameterless constructors to both MyPrincipal and MyIdentity, but that doesn't help.

Has this been tested/used with Silverlight? If not, will it work? I suppose I could always implement a custom command based on CommandBase and do the work on the server rather than trying to use the objects from the client.

--Doug

RockfordLhotka replied on Thursday, November 13, 2008

There's a test app in the cslalighttest folder that demonstrates how to use MembershipIdentity.

There's a simpler test for WPF in the Samples\CslaNet folder too. It is simpler because it was written after we changed MembershipIdentity to not be abstract - so it just creates an instance of MembershipIdentity directly.

Copyright (c) Marimer LLC