实体框架数据提供者没有找到,entityclient [英] Entity Framework data provider not found, entityclient

查看:204
本文介绍了实体框架数据提供者没有找到,entityclient的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我发现了许多问题,相关的或认为等同于我的问题没有什么但是似乎是工作了我。很多答案

First off, I've found many questions and many answers related or perceived identical to my issue however nothing seems to be working out for me.

我有一个全新的模板MVC4网站,在一个新的一个全新的数据库安装SQL Server 2008 R2的。
我aspnet_regsql运行数据库和创建的所有表
我创建了生成的ConnectionString在我的web.config中的.edmx模式。

I have a brand new templated MVC4 website, a brand new database in a fresh install of sql server 2008 r2. I ran aspnet_regsql on the database and created all the tables I created the .edmx model which generated the connectionstring in my web.config.

<connectionStrings>
  <add name="TestEntities" connectionString="metadata=res://*/Models.Test.csdl|res://*/Models.Test.ssdl|res://*/Models.Test.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=WEBSRV\SQLEXPRESS;initial catalog=Test;persist security info=True;user id=Test;password=Test#1337;multipleactiveresultsets=True;App=EntityFramework&quot;"  providerName="System.Data.EntityClient" />
</connectionStrings>

构建网站返回我的错误
无法找到所请求的.NET Framework数据提供程序。它可能没有安装。

有没有自我结束&LT; D​​bProviderFactories /&GT; 在我的machine.config
同样的问题发生羯羊我在Visual Studio的Web主机或我的web服务器的IIS在本地运行的网站。
我还没有安装任何的NuGet包

There is no self closing <DbProviderFactories/> in my machine.config The same issue happens wether I run the website locally in the visual studio web host or on my webserver's IIS. I have not installed any NuGet packages

为什么我得到这个错误?

Why do I get this error?

推荐答案

好吧,我想通了这个问题。

Right, I figured out the issue.

您不能使用的ConnectionString为别的比EDMX连接。
我有它在我的web.config的方式,使网站使用相同的ConnectionString成员资格的东西太多,这是不符合System.Data.EntityClient提供商兼容,需要与System.Data.SqlClient在我的情况。添加第二个的ConnectionString,减去的实体框架的东西,并具有引用成员资格提供程序在web.config属性中删除所有的错误,并允许网页渲染和SQL服务器请求的东西。

You cannot use that connectionstring for anything else than the edmx connection. The way I have it in my web.config makes the website use that same connectionstring for the membership stuff too, which is not compatible with the System.Data.EntityClient provider and needs the System.Data.Sqlclient in my case. Adding a second connectionstring, minus the Entity Framework stuff in it and having that referenced by the membership provider attributes in the web.config removes all errors and allows the page to render and request stuff from the SQL server.

在恶梦,可以回到在我的网站工作。 O /

Nightmare over, can return to work on my website. o/

这篇关于实体框架数据提供者没有找到,entityclient的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆