MVC4 - WebMatrix.WebData.SimpleMembershipProvider vs System.Web.Security.MembershipProvider
-
So... with MVC4 and foreseeable future, you can't use
System.Web.Security.MembershipProvider
And must extend your membership provide by inheriting from: WebMatrix.WebData.SimpleMembershipProvider or
WebMatrix.WebData.ExtendedMembershipProvider
I say you can't extend System.Web.Security.MembershipProvider because you'd run into the following error when "AccountController" calls "WebSecurity.Login":
"membership.provider" property must be an instance of "extendedmembershipprovider".
Am I understanding this correctly? You must now use WebMatrix SimpleMembershipProvider? - that System.Web.Security.MembershipProvider is obsolete in MVC space? that it's only suitable for web forms? What's bothering me is, with SimpleMembershipProvider, you must call WebSecurity.InitializeDatabaseConnection at least once - what if I don't store my users in db? What if I just store my users in simple local csv? or xml file? I think I found the answer here - new MVC 4.0 AccountController not compatible with old System.Web.Security.MembershipProvider.[^]. Thank you Uncle Soft! I so enjoy learning new patterns, especially when it does the same thing!
The new ASP.NET MVC 4 Internet application template AccountController requires SimpleMembership and is not compatible with previous MembershipProviders
You can continue to use existing ASP.NET Role and Membership providers in ASP.NET 4.5 and ASP.NET MVC 4 - just not with the ASP.NET MVC 4 AccountController
The existing ASP.NET Role and Membership provider system remains supported, as it is part of the ASP.NET core