2

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.

NuGet Loop

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.

Ken Palmer
  • 2,355
  • 5
  • 37
  • 57

1 Answers1

3

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.

Community
  • 1
  • 1
Leo Liu
  • 71,098
  • 10
  • 114
  • 135