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

感情迁移 提交于 2020-07-21 06:25:53

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/53181032/how-do-i-fix-this-nuget-restart-loop-in-visual-studio-2017

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!