I am working on a project that revolves around EF. I have the core layers of my project separated into different projects.
Unfortunately I constantly get errors that are happening because I am missing a reference to EntityFramework.SqlServer.dll in my project.
Adding the .dll file to my build folder fixes this issue, but I want to solve it by a "using" statement in my code, however I cannot do that as I am missing a reference to Entity Framework in my project.
I was wondering how do I add one?
*PS If I serach for EntityFramework in the "Add reference" panel, I don't get EF as an option.
**I could always install it with NuGet, but wouldn't that be redundant, since I already have it installed?
You can install the EntityFramework package by right-clicking on the References folder of your project and selecting Manage NuGet Packages…
I had the same issue on a N-tier solution where the DAL uses EF.
I solved it by adding a reference to the EntityFramework.SqlServer.dll in the web project.
Go to references --> Add Reference --> in the dialog, choose COM and press browse. Then go to your project which is using EF and go to the projects bin folder where the EF references are stored. Select the EntityFramework.SqlServer.dll and add it.
Then right click on the newly added reference --> Properties --> Select Copy Local to true
You can also use Nuget by right-click on your project -> Manage Nuget Packages, then search for "EntityFramework". Install the Entity Framework with Nuget from Microsoft.
It will add both EntityFramework and EntityFramework.SqlServer packages.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With