Error in ASP.NET MVC 4 with Generic Providers

I created a new simple ASP.NET MVC 4 Internet Project, then created models with the ADO.NET Entity data model design, and then I installed System.Web.Providers (Universal Providers) and configured Web.config to have two different data sources. 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 is working. But when I try to log in, this exception I get:

To call this method, the "Membership.Provider" property must be an instance of "ExtendedMembershipProvider".

I also added <add key="enableSimpleMembership" value="true" />to Web.config because someone in different forums solved the problem with this. This was not my case, the same error persists.

Can anyone help me?

+5
source share
2 answers

ASP.NET MVC4 comes with simple membership, and simple membership works with SQL CE out of the box, you don't need (and really can't) universal providers with Simple Membership.

+2
source

From this ASP.NET Forum Post:

Thanks for the tip. Now that I was able to see that the supplier being captured, I added

<appSettings>     
    <add key="enableSimpleMembership" value="true" />
</appSettings>

Everything seems to be working fine now.

0
source

All Articles