Stop EF database initialization for DefaultMembershipProvider

Team, I have an ASP.NET MVC application that I am deploying. When I deploy it, the application works fine, but when I call Membership.CreateUser, it tries to create the database, even if it already exists. What do I need to do to get it so that it does not try to call CreateMembershipEntities, since the database already exists?

I tried Database.SetInitializerfor an initializer that does nothing, I tried to delete defaultConnectionFactoryin Web.config - at the moment I am not in the settings.

I look forward to your help!

UPDATE

I just found out yesterday that the reason he is trying to create a database is because the host servers do not allow the connection to the request sysdatabases, and therefore the database never exists and therefore always tries to create it. It looks like I might have to go back to the old-fashioned AspNet membership provider and also get away from the first EF code model.

<rant> For a more personal note, I wanted to inform Microsoft, thanks for nothing! This first code model works well with applications that are deployed to your servers, but put them in the cloud (in any case, this all happens), and you're out of luck. Great job Microsoft! Why not just try and actually connect to the database to find out if it exists ?! If the connection succeeds, it must exist - otherwise, I think it is not. </rant>

+5
source share
1 answer

: http://www.qualitydata.com/learn/web-config-membership-provider-settings web.config. connectionStringName = "Your Connection String". .

+1

All Articles