Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The EntityFramework package is not installed on project

I am having trouble getting the EF to install on my very simple project called 'Match' (just now learning MVC, better late than never). The general context here is that I created the Model class with only 2 fields and now I want to change the Model class to have a few more fields/properties. I have made the change in the Model class and am now trying to update the DB to match. I am trying to use Update-Database from EF to do that.

PM> install-package EntityFramework You are downloading EntityFramework from Microsoft, the license agreement to which is available at http://go.microsoft.com/fwlink/?LinkId=253898&clcid=0x409. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device. Successfully installed 'EntityFramework 5.0.0'. Successfully added 'EntityFramework 5.0.0' to Match.

Type 'get-help EntityFramework' to see all available Entity Framework commands.

PM> Enable-Migrations Get-Package : A parameter cannot be found that matches parameter name 'ProjectName'. At C:\Users\Dave\Documents\Visual Studio 2010\Projects\Match\packages\EntityFramework.5.0.0\tools\EntityFramework.psm1:611 char:40 + $package = Get-Package -ProjectName <<<< $project.FullName | ?{ $_.Id -eq 'EntityFramework' } + CategoryInfo : InvalidArgument: (:) [Get-Package], ParameterBindingException + FullyQualifiedErrorId : NamedParameterNotFound,NuGet.PowerShell.Commands.GetPackageCommand

The EntityFramework package is not installed on project 'Match'.

like image 798
user1016313 Avatar asked Aug 12 '12 14:08

user1016313


1 Answers

Hopefully no-one is as stupid as me, but for the benefit of searchers:

One possibility for this error - In the Package Manager Console, there is a dropdown for 'Default Project'. If this is set incorrectly, you will get The EntityFramework package is not installed on project 'x'. Change the dropdown to your EF project and all is good again.

like image 61
JsAndDotNet Avatar answered Sep 19 '22 04:09

JsAndDotNet