提取一些代码更新后,我发现在构建时收到了此消息.
After pulling some code updates I found I got this message when building.
Some NuGet packages are missing from the solution. The packages need to be restored in order to build the dependency graph. Restore the packages before performing any operations在解决方案资源管理器中,参考链接显示为缺少参考图标
In solution explorer the references links displayed with a missing reference icon
我删除了引用,然后在软件包管理器控制台上出现一个按钮,询问我是否要安装缺少的软件包.但是,这没有用.
I deleted the references Then at the package manager console a button appeared asking if I wanted to install the missing packages. However, this did not work.
推荐答案当我尝试在解决方案之外自行打开项目并对其进行构建时,我收到了消息.
When I tried opening the project on its own , outside the solution, and buidling it I received the message.
一个或多个NuGet程序包需要还原,但不能还原,因为尚未获得同意.要表示同意,请打开"Visual Studio选项"对话框,单击程序包管理器"节点,然后选中允许NuGet在生成过程中下载丢失的程序包".您还可以通过将环境变量"EnableNuGetPackageRestore"设置为"true"来表示同意.
One or more NuGet packages need to be restored but couldn't be because consent has not been granted. To give consent, open the Visual Studio Options dialog, click on the 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'.
我授予VS权限,然后在程序包管理器控制台中运行
I granted VS the permission, then I ran at the package manager console
update-package -Reinstall更多推荐
Visual Studio应用程序解决方案中缺少某些NuGet程序包
发布评论