Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error using nuget in VS2012 "missing packages"

When I build my project from within VS2012 I get the following error message

This project references NuGet package(s) that are missing on this computer.  Enable NuGet Package Restore to download them.  

I have the nuget options set for NuGet to download missing packages.

picture of nugget options

Yet I still get the error. I have nugget 2.7 installed. With VS2012 update 3

like image 212
John S Avatar asked Sep 16 '13 17:09

John S


People also ask

How do I fix a missing NuGet package?

Enable package restore by choosing Tools > Options > NuGet Package Manager. Under Package Restore options, select Allow NuGet to download missing packages. In Solution Explorer, right click the solution and select Restore NuGet Packages.

How do I force a NuGet package to reinstall?

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.


1 Answers

Please follow below mentioned steps:

Step 1: Please enable Nuget Package Restore by right clicking on solution [as mentioned in below screenshot]

Enable Nuget Package Restore

Step 2: [Follow this if the issue / error is not resolved by following step 1] Still if you face the issue, please open .csproj file in notepad and check for the package path which might look like

Package Path

So your solutions directory structure will be like:

\SolutionDirectory\ 

Package Directory:

\SolutionDirectory\packages 

Project Directory:

\SolutionDirectory\ProjectName\ProjectName.csproj 

Please open this .csproj [in which you're getting error] in notepad and search for packages path and update it to its relevant path.

For e.g. my .csproj contained, if .csproj file contains ..\..\packages then update that path with ..\packages

like image 105
Nirav Mehta Avatar answered Sep 20 '22 14:09

Nirav Mehta