The type 'System.Data.Entity.DbContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'EntityFramework 2

Solution 1:

I think your EntityFramework version was confused

Please download the correct version by using the NuGet package installer.

See this discussion for getting started: The type or namespace name 'DbContext' could not be found

And look this same problem and Answer : is Here

Solution 2:

I found this solution suitable for me.

Adding Entity Framework DLL Reference:-

  1. Go to c:\Program Files (x86)\Microsoft ASP.NET\ASP.NETMVC 4\Packages\EntityFramework 5.0.0-rc\lib\net45

  2. Add Entity framework DLL

Solution 3:

I suggest you to check:

Allow NuGet to download missing packages during build ticked please refer this link