NuGet not updating project references

So I recently had a very similar issue as well, unfortunately uninstalling and reinstalling did not work. Hopefully this helps anyone else as it was very frustrating.

Steps:

  1. go to or launch the quick launch feature.
  2. type package manager
  3. select "tools->Nuget PackageManager-> Package Manager Settings"
  4. In the options window that pops up. click "Clear All Nuget Cache(s)"
  5. Right click solution and select Restore Nuget Packages.

Hope this helps.


We realized that some of our junior developers only installed the required Nuget packages for ONE project in the solution, they then added references to the required dll's for all other projects by browsing to the physical location of the dll's on disk. This obviously caused the problem because only ONE of the projects in the solution contained entries for Nuget packages in it's packages.config file while the remaining projects in the solution contained none.

When all packages were updated using the Update-Package command only the ONE project containing entries in it's packages.config file were updated with the correct project references.

Even though this is not a Nuget bug and rather a problem caused by inexperience, I logged an issue with Nuget to see if they can improve the software to prevent these types of problems.


NuGet package restore does not modify the project files. It just downloads and extracts the NuGet packages to the packages directory.

If you are trying to edit the packages.config file and then have the project's updated you would have to use the Package Manager Console and run:

Update-Package -reinstall

Which will uninstall and install the packages again and update the project's references.

Tags:

Nuget