NuGet restore / install fails / error causes

Date: 2022-10-17

Path contains html escapes

# When cloning from git some programs use html character escaping, e.g.

C:\Workspace\My%20Project\MySolution.sln

# the result is visual studio not recognizing the nuget packages anymore
# Fix it by removing the escapes:

C:\Workspace\My Project\MySolution.sln

# reinstall the nuget packages, now it works..

When it just doesn’t work anymore

NuGet reinstall all packages

NuGet clear all caches

%userprofile%\.nuget\packages
%localappdata%\NuGet\v3-cache
%temp%\NuGetScratch

Remove-Item -Recurse -Force "$env:USERPROFILE\.nuget\packages"
Remove-Item -Recurse -Force "$env:LOCALAPPDATA\NuGet\v3-cache"
Remove-Item -Recurse -Force "$env:TEMP\NuGetScratch"

Remove manually:
<solutionfolder>\packages


via nuget.exe:

nuget locals all -clear

or:

nuget locals global-packages -clear
nuget locals http-cache -clear
nuget locals temp -clear




possibly clear VisualStudio ComponentModelCache:

%localappdata%\Microsoft\VisualStudio\<version>\ComponentModelCache
68630cookie-checkNuGet restore / install fails / error causes