Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nuget - Don't see allow nuget to download missing packages during build

I get a message saying the following:

Error 1 Package restore is disabled by default. To give consent, open the Visual Studio Options dialog, click on Package Manager node and check 'Allow NuGet to download missing packages during build.' You can also give consent by setting the environment variable 'EnableNuGetPackageRestore' to 'true'.

When I go to Tools -> Options, I do not see Package Manager and underneath I see Package Sources and Recent Packages. I do not see anywhere where I can set Allow Nuget to download missing packages during build though.

like image 590
Nate Pet Avatar asked Jun 29 '12 11:06

Nate Pet


People also ask

How do I allow NuGet to download missing packages?

Enable package restore by choosing Tools > Options > NuGet Package Manager. Under Package Restore options, select Allow NuGet to download missing packages.

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 manually download NuGet?

Either make an account on the Nuget.org website, then log in, browse to the package you want and click on the Download link on the left menu. Then simply unzip the . nupkg file and extract the contents you need.

How do I enable manage NuGet packages in Visual Studio?

In Solution Explorer, right-click References and choose Manage NuGet Packages. If you want more information on the NuGet Package Manager, see Install and manage packages using Visual Studio. Accept any license prompts. If prompted to review changes, select OK.


1 Answers

The option to give consent in the UI has been added with NuGet Package Manager 1.8. It's the 3rd item under Tools-> Options-> Package Manager-> General : "Package Restore : Allow NuGet to download missing packages during build".

Please make sure NuGet is up-to-date in Tools->Extension Manager.

Alternatively you can give consent by setting the EnableNuGetPackageRestore Environment variable to true.

like image 72
Alexandre Dion Avatar answered Oct 10 '22 18:10

Alexandre Dion