November 15, 2011
|
MembershipProvider error in ASP.NET Web Pages
|
5610 hit(s)
If you use membership in ASP.NET Web Pages, you might get the error To call this method, the "Membership.Provider" property must be an instance of "ExtendedMembershipProvider"
:
I happened to run across this while playing around with the new OAuth login capabilities in the beta version of Web Pages 2, but you might see it under other conditions as well.
Per one of our testers, this can indicate that the server has no AspNetSqlMembershipProvider
configured. (A clue here is that everything works great when you test locally, but then throws an error when you deploy to your hosting provider.)
In my case, I fixed this by adding the following to the site's local Web.config file:
<appSettings>
<add key="enableSimpleMembership" value="true" />
</appSettings>
This is a child of the <configuration>
element and a peer of the <system.web>
element.
Anyway, that worked for me. I'm curious if others have seen this error and if so, how they fixed it.