After downloading the EF6 by nuget and try to run my project, it returns the following error:
No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlClient'. Make sure the provider is registered in the 'entityFramework' section of the application config file. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.
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.
I managed to fix it by running the following command on Package Manager Console:
Add below to your app.config.
everybody I need your Attention that two dll EntityFramework.dll And EntityFramework.SqlServer.dll are DataAccess layer Library And it is not Logical to Use them in view or any other layer.it solves your problem but it is not logical.
logical way is that enitiess attribute remove and replace them with Fluent API.this is real solution
When you install Entity Framework 6 through
Nuget
. EntityFramework.SqlServer sometime miss for another executable. Simply add theNuget
package to that project.Sometimes above does not work for Test Project
To solve this issue in Test Project just place this Method inside Test Project:
This method is never been called, but as my observations, the compiler will remove all "unnecessary" assemblies and without using the
EntityFramework.SqlServer
stuff the test fails.You don't need to install Entity Framework in your Console application, you just need to add a reference to the assembly EntityFramework.SqlServer.dll. You can copy this assembly from the Class Library project that uses Entity Framework to a LIB folder and add a reference to it.
In summary:
I hope it helps.
I just run into this problem today. I have data repository class library with EF63 NuGet package and console application for testing, which have reference only to class library project. I created very simple post-build command, which copies EntityFramework.SqlServer.dll from class library's Bin\Debug folder to console application's Bin\Debug folder and problem solved. Do not forget to add entityFramework section to console application's .config file.