NuGet 包还原 - “默认情况下禁用包还原.要表示同意,请打开“Visual Studio 选项"对话框" [英] NuGet package restore - "Package restore is disabled by default. To give consent, open the Visual Studio Options dialog"

查看:66
本文介绍了NuGet 包还原 - “默认情况下禁用包还原.要表示同意,请打开“Visual Studio 选项"对话框"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从构建服务器上的命令行使用 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:

默认情况下禁用包恢复.要表示同意,请打开 Visual Studio 选项对话框.

如果没有在构建服务器上安装 VS2010,我该怎么做?(不,我不这样做).有没有注册表设置之类的?NuGet 如何确定包还原已禁用.确实,为什么他们甚至会关心默认禁用此功能?

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?

推荐答案

目前正在发生这种情况,因为 NuGet Package Restore 需要在下载包之前获得同意,并且按照当前的工作方式,无法识别调用nuget.exe"的用户从包恢复安装packages.config".有关同意的更多详细信息:http://blog.nuget.org/20120518/package-restore-and-consent.html

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.

作为一种解决方法,您可以通过将 EnableNuGetPackageRestore 环境变量设置为 true 来表示同意.

As a workaround, you can give consent by setting the EnableNuGetPackageRestore environment variable to true.

这篇关于NuGet 包还原 - “默认情况下禁用包还原.要表示同意,请打开“Visual Studio 选项"对话框"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆