System.Data.Entity.DbContext can't find to add as a reference

c# entity-framework

Question

When I go to build my project, I get this error:

The type 'System.Data.Entity.DbContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

I am trying to access my DbContext that I created with EF5. I tried to add System.Data.Entity.DbContext to my references, but I couldn't find it. What should I do?

1
3
10/31/2018 7:50:57 PM

Accepted Answer

  1. Select the project which throws this error
  2. Go to the menu View -> Other windows -> Package Manager Console
  3. Make sure your problematic project got selected in the default Project" drop-down in the PMC console.
  4. then type the command "install-package entityframework -version 5.0.0.0"

It should install the missing version.

3
3/21/2014 5:46:57 PM

Popular Answer

  1. Go to the Solution Explorer
  2. Right-Click on References -> Manage NuGet Packages...
  3. Select Online-> Microsoft and .NET Click
  4. Click Install next to .Net EntityFramework


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow