In addition to the accepted answer, this can help people in a situation that has not yet been mentioned:
This problem arose for me when I created a new mvc4 project in an existing solution in Visual Studio 2012. The solution already contained a working mvc4 project, but when I created a second project, it could not find the System.Data.Entity package (including DbContext). The install-package command does not solve the problem in this situation, since the package is already installed in the general solution:
PM> Install-Package EntityFramework 'EntityFramework 6.0.1' already installed.
The problem was that the EntityFramework package is not automatically installed in new projects, you need to add it manually. Switch to:
Tools -> Library Package Manager -> "Manage NuGet Packages for Solution..."
Locate EntityFramework in the box at the top right, click Manage, and then select the check box for the new solution. The new project should now build correctly.
source share