问题描述
我正在尝试添加ASP.NET简单会员资格到我的MVC 5应用程序。当应用程序启动Global.asax.cs中的初始化部分时 - Application_Start()给我以下错误:我正在通过调用
$初始化会员资格b $ b
WebSecurity.InitializeDatabaseConnection(CareerEntities,UserProfile,UserId,UserName,true);
我有以下连接字符串(我正在使用Entity框架数据库)
< add name =CareerEntitiesconnectionString =metadata = res://*/Models.Career.csdl | res:// * / Models .Career.ssdl | res://*/Models.Career.msl; provider = System.Data.SqlClient; provider connection string =& quot; data source = .\SQLEXPRESS; initial catalog = Career; integrated security = True ; MultipleActiveResultSets = TRUE;应用=&的EntityFramework放大器; QUOT; providerName =System.Data.EntityClient/>
我尝试将提供程序名称更改为System.Data.SqlClient,但没有
我发现解决方案
另外我有一个错误,我应该定义默认与System.Data.SqlClient的连接和其他实体框架连接System.Data.EntityClient
I am trying to add ASP.NET Simple Membership to my MVC 5 application. When the application start the initialization part in Global.asax.cs - Application_Start() gives me the following error:
I'm initializing the membership by calling
WebSecurity.InitializeDatabaseConnection("CareerEntities", "UserProfile", "UserId", "UserName", true);
I have following connection string (I'm using Entity framework Database first)
<add name="CareerEntities" connectionString="metadata=res://*/Models.Career.csdl|res://*/Models.Career.ssdl|res://*/Models.Career.msl;provider=System.Data.SqlClient;provider connection string="data source=.\SQLEXPRESS;initial catalog=Career;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
I tried to change the provider name to be "System.Data.SqlClient" but it didn't work either
I found the solution Here
Also I had a mistake that i should define the Default connection with "System.Data.SqlClient" and the other Entity framework connection "System.Data.EntityClient"
这篇关于简单会员资格让我无法找到所请求的.Net框架数据提供者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!