Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NuGet package restore - "Package restore is disabled by default. To give consent, open the Visual Studio Options dialog"

Tags:

nuget

I'm trying to use NuGet package restore from the command line on a build server.

nuget install myapp/packages.config 

However, I get the following error message:

Package restore is disabled by default. To give consent, open the Visual Studio Options dialog.

How am I supposed to do that without installing VS2010 on the build server? (no, I'm not doing that). Is there a registry setting or something? How is NuGet determining that package restore is disabled. Indeed, why is this something that they would even care about making disabled by default?

like image 901
Nathan Ridley Avatar asked Aug 10 '12 16:08

Nathan Ridley


1 Answers

Another way is adding

<packageRestore>     <add key="enabled" value="True" />     <add key="automatic" value="True" /> </packageRestore> 

to file %USERPROFILE%\AppData\Roaming\NuGet\nuget.config.

like image 101
Fei Ling Avatar answered Sep 24 '22 23:09

Fei Ling