Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nuget package manager out of sync

I am on Nuget 2.5.4. The 'Manage packages for entire solution' feature to install Updates is intermittently showing 'false positives'.

By false positive, I mean an indication that something in the solution needs an update, BUT every project in the solution is already at the latest update. At least I think that is what is going on.

For example (see below), nuget is offering to help install NUnit but every package is grayed out. The test projects should be grayed out since they are already at the latest release.

Packages without NUnit are also grayed out though, and I would think they should not be, so the solution manager can install them. So not sure if my false positive theory is correct, but something is out of sync.

What is the fix?

Cheers,

enter image description here

enter image description here

like image 759
Berryl Avatar asked May 28 '13 18:05

Berryl


3 Answers

From the output of Process Monitor it seems that the solution wide updates are determined based on the contents of the Packages folder that is under the root of the solution:

It scans the folder and checks for updates for all of the packages that have been downloaded there, and it will display that there's an update for an old package even if the newer package is also there.

So in order to sync this, you should clear this folder, and then restore the packages of your solution. After that, the next time you open this dialog, it will show the correct results.

like image 139
argaz Avatar answered Oct 20 '22 19:10

argaz


Go directly to the packages physical directory for the solution, something like C:\projects\\packages.

Ensure that the false positives do not have older versions in this directory alongside the current versions.

like image 21
Mac Avatar answered Oct 20 '22 20:10

Mac


My source control sometimes locks the config files such that my web.config and packages.config are sometimes out of sync after a NuGet update.

The output window that normally displays build events will show what usually went wrong with a NuGet update/install.

Most of the time releasing the readonly on the config files then doing another update will fix the config files. If that doesn't work I have to remove and re-install some packages.

Edit: Depending on your project type you may not have a web.config and not all packages write to the app config settings.

like image 1
Jasen Avatar answered Oct 20 '22 18:10

Jasen