Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error : The EntityFramework package is not installed on project

I've just installed SQL Server 2008, configured my ASP.NET MVC 4 project to be deployed at Local IIS and have added a new connection to a database which have been created at time (in sql server 2008).

When I try to enable migrations (Entity Framework) via Enable-Migrations -ContextTypeName MonitoringNDataContext from Package Manager Console. I got this following error :

The EntityFramework package is not installed on project 'MonitoringN.Tests'.

Any brilliant idea, please ?

  • MonitoringN : Name the ASP.NET MVC 4 project.
  • MonitoringNDataContext : Name of my DBContext class which is placed into MonitoringN.
  • MonitoringN.Tests : Name of the Unit Test project related to MonitoringN.
like image 205
user3264174 Avatar asked Feb 03 '14 17:02

user3264174


2 Answers

In Package Manger Console you have Default project dropdown list. Check that you select MonitoringN project in it and not the MonitoringN.Tests project.

like image 103
freshbm Avatar answered Sep 23 '22 07:09

freshbm


In the Package Manager Console, choose the default project to the your project which has dbcontext. If this is set incorrectly, you will get The EntityFramework package is not installed on project 'x'. Change the dropdown to your EF project.

This worked for me.

like image 34
Krishna Avatar answered Sep 21 '22 07:09

Krishna