Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NuGet Package restore IS enabled but I get an error saying it's not enabled

I have nuget package restore enabled in my solution. However, when I try to build the project, I get this error:

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

Any ideas how to fix this problem?

I have tried deleting my NuGet.targets and NuGet.exe file and re-enabling nugget package restore. It recreates the files and I get the same error.

like image 511
Kyle Avatar asked Nov 08 '13 00:11

Kyle


People also ask

How do I fix a NuGet package error?

Quick solution for Visual Studio users Select the Tools > NuGet Package Manager > Package Manager Settings menu command. Set both options under Package Restore. Select OK. Build your project again.

How do I run a NuGet package restorer?

It is available in the main menu (Tools | NuGet | NuGet Force Restore) or in the NuGet quick list Alt+Shift+N .

Why is manage NuGet packages disabled?

The Add NuGet packages menu will be disabled if a project is not selected in the Solution window. Which is my guess as to why it is disabled for you. Update and Restore NuGet packages is available if a solution or project is selected.


2 Answers

Try and see if this helps:

in solution explorer, right click on the project name and select 'Enable Nudget package restore'

also remember to rebuild each of your projects

wait until it gets restored and run the project if it works fine

like image 152
Taeb Ali Khan Avatar answered Sep 18 '22 14:09

Taeb Ali Khan


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 39
Nirav Mehta Avatar answered Sep 18 '22 14:09

Nirav Mehta