如何在 Visual Studio 2017 中修复此 NuGet Restart 循环? [英] How do I fix this NuGet Restart loop in Visual Studio 2017?

查看:34
本文介绍了如何在 Visual Studio 2017 中修复此 NuGet Restart 循环?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无论我重新启动应用程序多少次,NuGet 提示多个包无法卸载.重新启动 Visual Studio 以完成该过程"在 Visual Studio 2017 中反复出现.

我选择工具">NuGet 包管理器">管理解决方案的 NuGet 包".然后出现这个对话框.

我们在 VS 2017 中有一个解决方案,其中包含多个无法解析的 NuGet 包引用.一位同事添加了这些引用,但当我加载解决方案时,它们在解决方案资源管理器的bin"目录中显示为黄色三角形.

缺少的引用是针对 .pdb 和 .xml 文件的.在我的 PC 上重新安装 Visual Studio 2017 后,这些问题开始出现.

真的,我不想删除引用.我要他们解决.我想摆脱这个 NuGet Restart 循环.也许我的 NuGet 包管理器设置需要调整,或者我需要使用 NuGet 命令提示符来解决这个问题.只是不知道接下来的步骤.感谢您的帮助.

解决方案

如何在 Visual Studio 2017 中修复此 NuGet Restart 循环?

这个 nuget 包似乎被其他进程锁定,例如文件资源管理器.

要解决此问题,请先关闭所有 Visual Studio 实例,然后尝试删除解决方案文件夹中的 \packages 文件夹并手动删除 \bin 文件夹.如果您的项目类型是.net core/.net standard,则需要清除包缓存:

# 清除所有缓存(使用任一命令)dotnet nuget 本地人全部 --clearnuget 本地人全部清除

以上操作后不要忘记重启电脑.

检查文档清除本地文件夹了解更多详情.

另外,不要担心那些引用会被删除,当你构建项目时,nuget 会恢复那些包,如果发现任何引用丢失,只需在包管理器控制台中执行 NuGet 命令行:

Update-Package -reinstall

NuGet 将重新安装这些包并添加对项目的引用.

查看类似主题了解更多详情.>

希望这会有所帮助.

The NuGet prompt, "Multiple packages failed to uninstall. Restart Visual Studio to finish the process," appears repeatedly in Visual Studio 2017 no matter how many times I restart the application.

I'm selecting Tools > NuGet Package Manager > Manage NuGet Packages For Solution. Then this dialog appears.

We have a solution in VS 2017 with multiple NuGet package references which will not resolve. A colleague added these references, but when I load the solution they show up with the yellow triangles in the "bin" directory in Solution Explorer.

The missing references are for .pdb and .xml files. These problems started occurring after Visual Studio 2017 was reinstalled on my PC.

Really, I don't want to remove the references. I want them to resolve. And I want to get out of this NuGet Restart loop. Perhaps my NuGet package manager settings need to be adjusted, or I need to use the NuGet Command Prompt to fix this. Just don't know the next steps. Thanks for your help.

解决方案

How do I fix this NuGet Restart loop in Visual Studio 2017?

It seems this nuget package is locked by other process, like File Explorer.

To resolve this issue, close all the Visual Studio instance first, then try to delete the \packages folder in the solution folder and delete the \bin folder manually. If you project type is .net core/.net standard, you need to clear the packages cache:

# Clear all caches (use either command)
dotnet nuget locals all --clear
nuget locals all -clear

Do not forget to restart the PC after above operations.

Check the document Clearing local folders for some more details.

Besides, do not worry those references will be removed, when you build the project, nuget will restore those package, and if find any reference missing, just execute NuGet command line in the Package Manager Console:

Update-Package -reinstall

NuGet will reinstall those packages and add references to the project.

Check the similar thread for some more details.

Hope this helps.

这篇关于如何在 Visual Studio 2017 中修复此 NuGet Restart 循环?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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