Visual Studio应用程序解决方案中缺少某些NuGet程序包

编程入门 行业动态 更新时间:2024-10-24 09:16:46
本文介绍了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程序包

本文发布于:2023-11-16 11:13:11,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1603765.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   解决方案   程序包   Visual   Studio

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!