找不到具有不变名称“System.Data.SqlClient”的ADO.NET提供程序的实体框架提供程序

本文翻译自:No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlClient'

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为我做了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值