The type or namespace name 'DbContext' could not be found (EF installed)

c# entity-framework visual-studio-2012

Question

I am using VS 2012. I installed with Nuget the EntityFramework (version 6.1.1), and add references to the System.Data and System.Data.Entity, but when I open a new class in the solution and refering to DbContext, it says:

"The type or namespace name 'DbContext' could not be found (are you missing a using directive or an assembly reference?)"

It's weird beacuse the DbContext is green, like every recognized class, when I press F12 to look into the DbContext class it brings me to the System.Data.Entity.DbContext class as it should be.

public DbContext MyContex { get; set; }

The same happanes with DbSet

public DbSet<TEntity> MySet { get; set; }

What else am I missing?

1
10
9/30/2015 11:58:44 AM

Popular Answer

Install-Package EntityFramework -version 5.0.0

5
3/26/2015 5:29:06 PM


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