After downloading the EF6 by nuget and try to run my project, it returns the following error: 通过nuget下载EF6并尝试运行我的项目后,它返回以下错误:
No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlClient'. 没有为ADO.NET提供程序找到具有不变名称“System.Data.SqlClient”的实体框架提供程序。 Make sure the provider is registered in the 'entityFramework' section of the application config file. 确保提供程序已在应用程序配置文件的“entityFramework”部分中注册。 See http://go.microsoft.com/fwlink/?LinkId=260882 for more information. 有关详细信息,请参阅http://go.microsoft.com/fwlink/?LinkId=260882 。
#1楼
参考:https://stackoom.com/question/1FRBL/找不到具有不变名称-System-Data-SqlClient-的ADO-NET提供程序的实体框架提供程序
#2楼
I just got into the same problem and it looks like EntityFramework although installed from NuGet Package Manager was not correctly installed in the project. 我刚刚陷入同样的问题,它看起来像EntityFramework虽然从NuGet包管理器安装没有正确安装在项目中。
I managed to fix it by running the following command on Package Manager Console : 我设法通过在Package Manager控制台上运行以下命令来修复它:
PM> Install-Package EntityFramework
#3楼
You can also see this message if you forget to include "EntityFramework.SqlServer.dll". 如果您忘记包含“EntityFramework.SqlServer.dll”,也可以看到此消息。
It appears to be a newly added file in EF6. 它似乎是EF6中新添加的文件。 Initially I hadn't included it in my merge module and ran into the problem listed here. 最初我没有将它包含在我的合并模块中,并遇到了此处列出的问题。
#4楼
You've added EF to a class library project. 您已将EF添加到类库项目中。 You also need to add it to the project that references it (your console app, website or whatever). 您还需要将它添加到引用它的项目(您的控制台应用程序,网站或其他)。
#5楼
I had a related issue when migrating from a CE db over to Sql Server on Azure. 从CE数据库迁移到Azure上的Sql Server时,我遇到了相关问题。 Just wasted 4 hrs trying to solve this. 只是浪费了4小时试图解决这个问题。 Hopefully this may save someone a similar fate. 希望这可以为某人留下类似的命运。 For me, I had a reference to SqlCE in my packages.config file. 对我来说,我在packages.config文件中引用了SqlCE。 Removing it solved my entire issue and allowed me to use migrations. 删除它解决了我的整个问题,并允许我使用迁移。 Yay Microsoft for another tech with unnecessarily complex setup and config issues. 是的,微软为另一项技术提供了不必要的复杂设置和配置问题。
#6楼
删除BIN-Folder为我做了