Unable to add EntityFramework reference to my unit test project

I have a new project that uses Entity Framework 5 with pleasure. After I added edmx to the solution, it added a link to EntityFramework version 5.

I created a unit test project and I need to use something in the EntityFramework library. However, there is no reference to EntityFramework. When I go to Add Reference, I cannot find it anywhere in the list.

I checked and my unit test references .NET 4.5. Any idea why I cannot add the link?

+7
source share
4 answers

Delete all entries you made in the web.config file. Right-click on the name of your project in the solution, click on "Manage Nudity Packages". On the left, click “Forward”, and on the right, click “Object Box” in the search field. Click Install

it will automatically do everything for you.

Answer taken from: EntityFramework 5 Installation error in VS 2012

+17
source

I had the same problem with a new application. I opened the package manager console and used install-package EntityFramework , which installed version 6 without any problems.

+4
source

You need to add a link to the System.Data.Entity DLL to the Links folder of your Unit Test project.

+1
source

Just adding System.Data.Entity might not be enough;

because you are trying to reference something that is not yet installed.

this problem can be solved by installing EntityFramework .

To do this:

  • Go to Solution Explorer
  • Right click on your project name
  • Select Manage NuGet Packages

Install Entity Framework

  • Now install the Entity Framework.

Nuget Application Manager

+1
source

All Articles