Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error when installing EntityFramework package over NuGet

I tried to install EntityFramework 4.1 on VS 2010 through NuGet. I searched and found the package through "Tools > Library Package Manager > Add Library Package Reference" tool and I got this error: "This package (or one of its dependencies) contains powershell scripts and needs to be installed from the package manager console.". This is what I did to fix it:

Tools > Library Package Manager > Package Manager Console
PM > get-package -remote -filter entityframework
(got some results including EntityFramework 4.1.10311.0)
PM > install-package -id EntityFramework
Successfully added 'EntityFramework ...

The question is:
1. What was wrong with "Add Library Package Reference" option? In this MS tutorial http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part4-cs it seems that it should work fine.
2. Is there a better solution?

Thanks to all.

like image 293
Marwan Avatar asked Mar 18 '11 13:03

Marwan


People also ask

How do I Install missing NuGet packages in Visual Studio 2019?

If a needed package isn't already installed, NuGet first attempts to retrieve it from the local global packages or HTTP cache folders. If the package isn't in the local folders, NuGet tries to download it from all sources configured in Visual Studio at Tools > Options > NuGet Package Manager > Package Sources.

How do I force a NuGet package to Install?

Switch to the Browse tab, search for the package name, select it, then select Install). For all packages, delete the package folder, then run nuget install . For a single package, delete the package folder and use nuget install <id> to reinstall the same one.

How do I import a Nupkg file into Visual Studio?

Menu Tools → Options → Package Manager Give a name and folder location. Click OK. Drop your NuGet package files in that folder. Go to your Project in Solution Explorer, right click and select "Manage NuGet Packages".


1 Answers

What version of NuGet are you using? Update to the latest in the VS Gallery. More info on how to upgrade here: http://www.hanselman.com/blog/NuGetActionPlanUpgradeTo11SetupAutomaticUpdatesGetNuGetPackageExplorer.aspx

In 1.1 we allows packages with install.ps1/uninstall.ps1 to be installed from the dialog, this wasn't the case before.

like image 129
davidfowl Avatar answered Oct 09 '22 10:10

davidfowl