C# 实体框架6:未找到ADO.NET的实体框架提供程序
我得到这个错误: 找不到具有固定名称“System.Data.SqlClient”的ADO.NET提供程序的实体框架提供程序。确保提供程序已在应用程序配置文件的“entityFramework”部分注册 但是在C# 实体框架6:未找到ADO.NET的实体框架提供程序,c#,entity-framework-6,C#,Entity Framework 6,我得到这个错误: 找不到具有固定名称“System.Data.SqlClient”的ADO.NET提供程序的实体框架提供程序。确保提供程序已在应用程序配置文件的“entityFramework”部分注册 但是在app.config文件中有一个部分 我的上下文类: public class NorthwindContext:DbContext { public NorthwindContext():base(nameOrConnectionString:"NorthwindContext"
app.config
文件中有一个
部分
我的上下文类:
public class NorthwindContext:DbContext
{
public NorthwindContext():base(nameOrConnectionString:"NorthwindContext")
{
}
public DbSet<Product> Products { get; set; }
public DbSet<Category> Categories { get; set; }
}
我该怎么修理?有人有想法吗?删除5.0版参考删除5.0版参考
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<connectionStrings>
<add name="NorthwindContext" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=Northwind;Integrated Security=SSPI;" providerName="System.Data.SqlClient" />
</connectionStrings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>