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?
This is currently happening because NuGet Package Restore needs consent before downloading packages and with the current way things work, there’s no way to discern a user calling “nuget.exe install packages.config” from package restore.
more details on consent here : http://blog.nuget.org/20120518/package-restore-and-consent.html
note: this issue should be fixed next week.
As a workaround, you can give consent by setting the EnableNuGetPackageRestore environment variable to true.