EntityFramework package not installed in project

I'm having trouble installing EF on my very simple project called “Match” (just now, studying MVC, better late than never). The general context here is that I created the Model class with only two fields, and now I want to modify the Model class to have a few more fields / properties. I made changes to the Model class, and now I'm trying to update the DB to match. I am trying to use Update-Database from EF for this.

PM> install-package EntityFramework You download EntityFramework from Microsoft, a license agreement, available at http://go.microsoft.com/fwlink/?LinkId=253898&clcid=0x409 . Check the package for additional dependencies that may have their own licensing agreements. Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not agree with the license agreement, remove 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 the available Entity Framework commands.

PM> Enable-Migrations Get-Package: the parameter cannot be found that matches the parameter name 'ProjectName'. In 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

EntityFramework is not installed in the Match project.

+54
visual-studio asp.net-mvc entity-framework nuget-package
Aug 12 2018-12-12T00:
source share
17 answers

Just upgrade NuGet to 2.x. EF 5.0 requires this.

+21
Aug 24 2018-12-12T00:
source share

I hope no one is as stupid as me, but in the interests of search engines:

One possibility for this error. The Package Manager console has a drop-down list for "Default Project." If this is not installed correctly, you will receive the EntityFramework package not installed in the project "x". Change the drop-down list to your EF project and everything will be fine again.

+215
Feb 05 '13 at 13:40
source share

In my case, rebooting Visual Studio helped.

+31
May 14 '16 at 16:24
source share

In my case, I had a project that for some reason did not have the Packages.config file. As a result, I received the error message "EntityFramework package is not installed in the xxxx project."

To solve this problem, simply add the Packages.config file and the “Install-Package EntityFramework”. Works.

+8
Nov 21 '13 at 9:33
source share

In my projects, I separately installed EntityFramework. Despite the fact that they all had the same version numbers for each project, it still didn't work. As a result, you will get the same error.

To fix this, I removed EntityFramework from all my projects and installed it again.

Get-Project -all | Uninstall-Package EntityFramework 

Then you just reinstall it again.

 Get-Project -all | Install-Package EntityFramework 
+5
Aug 04 '15 at 0:22
source share

I have the same problem. I added EFCore to the project that installed EF6. so the add-migration xx command runs with EF6 instead of EFCore, and I get this error. uninstalling EF6 and restarting Visual Studio solved my problem.

+4
Jan 19 '19 at 15:01
source share

You will need to install EF in your project. You can do it through Tools | Manage NuGet Packages, look in the "Installed" section and click "Manage". There you will see the option to install EF in your project. After that, everything should work, and model changes will be possible. This can take quite a while (in my case it was!). Success! Peter

+3
Aug 31 2018-12-12T00:
source share

In my case, I install the Microsoft.EntityFrameworkCore.Tools package in my project! The problem is fixed.

+3
Apr 08 '18 at 10:45
source share

Open the package manager console and select the default project from the drop-down list in the package manager console And install the entity framework using this command in the command window.

 install-Package Entityframework 
+2
Mar 07 '15 at 6:28
source share

I just restarted Visual Studio and it worked.

+2
May 19 '19 at 16:09
source share

Try updating the Entity Framework package from the Nuget package manager of your project, which solved my problem.

+1
Aug 27 '16 at 6:46
source share

In my case, the package.config file was on disk, but not in TFS.

0
Jul 16 '14 at 18:08
source share

This error can occur if the target project of the Entity Framework team is uploaded to the Visual Studio solution (that is, if you first right-click the project in the solution explorer and select "Unload Project").

In this case, the solution should load the project and then run the Entity Framework command again.

0
Jul 08 '16 at 17:06
source share

should work if you open a project for the first time,

second click on the console project and "Make Start Project"

0
Jan 05 '19 at 15:43
source share

install EntityFrameworkCore install EntityFrameworkCore.SqlServer and then close Visual Studio and reopen the fixed problem

0
Jan 17 '19 at 14:19
source share

You can also clear the NuGet cache in VS. solved my problem

0
Jul 16 '19 at 21:19
source share

In my case, I have a Xamarin.Forms solution with three projects - Backend (for connecting to the Azure database), one shared library, iOS project and Android project. Received error messages: "EntityFramework was not installed in the project ..." and "Assembly type was not found in the assembly ...". I solved this by installing Backend as my StartUp project, and then entering commands in the following format in the package manager console:

 Enable-Migrations -ProjectName Backend -Verbose 

and after that

 add-migration -ProjectName Backend Initial 

I hope this helps someone :)

0
Jul 28 '19 at 16:39
source share



All Articles