Visual Studio应用程序解决方案中缺少某些NuGet程序包 [英] Some NuGet packages are missing from the solution in Visual Studio Application

查看:1457
本文介绍了Visual Studio应用程序解决方案中缺少某些NuGet程序包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

提取一些代码更新后,我发现在构建时收到了此消息.

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程序包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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