Our CI server fails to restore our NuGet packages when attempting to build a project. It thinks they are already installed. Here are the logs:
build 16-Apr-2015 12:56:38 C:\build-dir\IOP-IOL-JOB1>nuget restore IOHandlerLibrary.sln -NoCache
build 16-Apr-2015 12:56:39 All packages listed in packages.config are already installed.
What causes NuGet to believe that the packages are installed? Is it something in the solution or in the project file?
Quick solution for Visual Studio usersSelect the Tools > NuGet Package Manager > Package Manager Settings menu command. Set both options under Package Restore. Select OK. Build your project again.
Enable package restore by choosing Tools > Options > NuGet Package Manager. Under Package Restore options, select Allow NuGet to download missing packages. In Solution Explorer, right click the solution and select Restore NuGet Packages.
Restore packages with NuGet Package Restore. NuGet Package Restore restores all of a project's dependencies that are listed in either a project file or a packages. config file. You can restore packages manually with nuget restore , dotnet restore , msbuild -t:restore , or through Visual Studio.
I also had the same issue, but for me even removing the packages
directory would result in All packages listed in packages.config are already installed.
.
Turns out the packages.config file was invalid. Well, sort of:
<packages xmlns="urn:packages">
...
</packages>
I do not know which tool inserted the XML namespace, but it is the reason why nuget was not trying to install any packages.
Changing this back to
<packages>
...
</packages>
solved it for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With