Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error in ASP.NET MVC 4 with Universal Providers

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=&quot;Data Source=C:\myentities.sdf&quot;" 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?

like image 452
daliz Avatar asked Nov 03 '22 17:11

daliz


1 Answers

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.

like image 124
Erik Funkenbusch Avatar answered Nov 15 '22 06:11

Erik Funkenbusch