I have created a new MVC 4 project in VS2012 and now experiencing problems trying to use a custom membership provider I have created, which inherits from MembershipProvider
.
The AccountController.Login
method throws this exception:
To call this method, the "Membership.Provider" property must be an instance of "ExtendedMembershipProvider".
Disabling enableSimpleMembership
and autoFormsAuthentication
(as recommended at asp.net 4.5 custom membership provider configuration throws strange exception) makes no difference.
Removing the WebMatrix.WebData.dll
, causes AccountController
to not compile as it references WebMatrix.WebData.WebSecurity
These are the steps I took:
In VS 2012 create a new APS.NET MVC 4 project (.net 4.0)
Add a new class called
CustomMembershipProvider
that implementsMembershipProvider
In the
web.config
setenableSimpleMembership = false
andautoFormsAuthentication = false
inappSettings
and add the membership provider insystem.web
Start the website in debug and click "Log in" on the page
Enter any old text for username and password
I get the exception:
To call this method, the "Membership.Provider" property must be an instance of "ExtendedMembershipProvider"
Any ideas?