I created a fresh simple ASP.NET MVC 4 Internet Project, then I have created models with the ADO.NET Entity Data Model designer and then I have installed System.Web.Providers (Universal Providers) and configured Web.config in order to have two different data sources, both using SQL CE 4.0.
These are my connection strings:
<add name="DefaultConnection" connectionString="Data Source=C:\maindb.sdf" providerName="System.Data.SqlServerCe.4.0" />
<add name="MyEntitiesModelContainer" connectionString="metadata=res://*/MyEntitiesModel.csdl|res://*/MyEntitiesModel.ssdl|res://*/MyEntities.msl;provider=System.Data.SqlServerCe.4.0;provider connection string="Data Source=C:\myentities.sdf"" providerName="System.Data.EntityClient" />
The application works. But when I try to login, this is the exception I get:
To call this method, the "Membership.Provider" property must be an instance of "ExtendedMembershipProvider".
I have also added <add key="enableSimpleMembership" value="true" />
in Web.config because someone on different forums solved the problem doing this. It wasn't my case, the same error remains.
Could anyone help me please?
ASP.NET MVC4 ships with simple membership, and simple membership works with SQL CE out of the box, you don't need (and in fact can't use) the universal providers with Simple Membership.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With