Visual Studio 应用程序中的解决方案缺少一些 NuGet 包
Some NuGet packages are missing from the solution in Visual Studio Application
拉取一些代码更新后,我发现在构建时收到了这条消息。
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
在解决方案资源管理器中,参考链接显示缺少参考图标
我删除了引用然后在包管理器控制台出现一个按钮询问我是否要安装丢失的包。但是,这没有用。
当我尝试在解决方案之外自行打开项目并构建它时,我收到了消息。
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'.
我 g运行ted VS 权限,然后我 运行 在包管理器控制台
update-package -Reinstall
第一次下载时 folder/zips 内容可能出错,因此请转到 Xamarin 文件夹 (C:/User/YourName/AppData/Local/Xamarin
) 并删除或重命名或移出缺少 nuget 的文件夹或 zips 文件夹的内容.
重新启动IDE,您IDE再次下载内容。我试过了,效果很好。
按Ctrl+Q并写下丢失包的名称,然后点击搜索在线NuGet包匹配。
它会显示菜单点击浏览,这会给你丢失的包点击安装,卸载或更新。
我正在写这个答案,因为我尝试了以下解决方案,但其中 none 有效:
- 正在清除缓存
- 恢复或重新安装包
- 更改目标框架
- 更新 Nuget 包管理器
然后我查看了一个下拉列表,发现错误很小。包源下线了!!我在我的系统上安装了VS2017专业版,打开一个已有的项目,发现少了多个包。我尽我所能,没有看包源!!
解决方案:
步骤 01.转到包管理器设置(工具 > Nuget 包管理器 > 包管理器设置)
步骤 02。检查包源。如您所见,包源已在此处下载 SDK/nugets/packages。我不知道原因,但是 nuget.org 的在线包源在我的 Visual Studio.
系统安装中丢失了
步骤 03. 安装 nuget.org 作为包源,然后 'Clear All Nuget Cache(s)' 然后恢复包。错误将消失。
姓名:nuget.org(或如您所愿)
资料来源:https://api.nuget.org/v3/index.json
拉取一些代码更新后,我发现在构建时收到了这条消息。
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
在解决方案资源管理器中,参考链接显示缺少参考图标
我删除了引用然后在包管理器控制台出现一个按钮询问我是否要安装丢失的包。但是,这没有用。
当我尝试在解决方案之外自行打开项目并构建它时,我收到了消息。
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'.
我 g运行ted VS 权限,然后我 运行 在包管理器控制台
update-package -Reinstall
第一次下载时 folder/zips 内容可能出错,因此请转到 Xamarin 文件夹 (C:/User/YourName/AppData/Local/Xamarin
) 并删除或重命名或移出缺少 nuget 的文件夹或 zips 文件夹的内容.
重新启动IDE,您IDE再次下载内容。我试过了,效果很好。
按Ctrl+Q并写下丢失包的名称,然后点击搜索在线NuGet包匹配。
它会显示菜单点击浏览,这会给你丢失的包点击安装,卸载或更新。
我正在写这个答案,因为我尝试了以下解决方案,但其中 none 有效:
- 正在清除缓存
- 恢复或重新安装包
- 更改目标框架
- 更新 Nuget 包管理器
然后我查看了一个下拉列表,发现错误很小。包源下线了!!我在我的系统上安装了VS2017专业版,打开一个已有的项目,发现少了多个包。我尽我所能,没有看包源!!
解决方案:
步骤 01.转到包管理器设置(工具 > Nuget 包管理器 > 包管理器设置)
步骤 02。检查包源。如您所见,包源已在此处下载 SDK/nugets/packages。我不知道原因,但是 nuget.org 的在线包源在我的 Visual Studio.
系统安装中丢失了步骤 03. 安装 nuget.org 作为包源,然后 'Clear All Nuget Cache(s)' 然后恢复包。错误将消失。
姓名:nuget.org(或如您所愿) 资料来源:https://api.nuget.org/v3/index.json