Nuget does not update project links

I recently migrated all Visual Studio 2013 projects to Visual Studio 2015 and followed the steps described in this article by Nuget to make sure automatic package recovery still works, in short

  • I deleted the Nuget.exe and Nuget.target files from the source control and drive
  • I updated all project files and deleted sections related to Nuget

I had a problem updating Nuget packages, this is not updating project links to point to the latest dll versions. I see that the latest packages have been installed. This problem is also not related to specific packages.

Has anyone else had such a problem?

+12
nuget
source share
6 answers

We realized that some of our junior developers installed in the solution only the necessary Nuget packages for ONE project, and then added links to the required dlls for all other projects, going to the physical location of the dll on the disk. This obviously caused the problem, because only ONE of the projects in the solution contained entries for the Nuget packages in its packages.config file, while the rest of the projects in the solution did not contain any.

When all the packages were updated using the Update-Package command, only ONE project containing the entries in this packages.config file was updated with the correct project links.

Although this is not a Nuget error, but rather a problem caused by inexperience, I registered the problem with Nuget to see if they could improve the software to prevent such problems.

+6
source share

Restoring a NuGet package does not modify project files. It simply downloads and extracts NuGet packages to the package directory.

If you are trying to edit the packages.config file and then update the project, you will have to use the package manager console and run:

 Update-Package -reinstall 

That will remove and install packages again and update project links.

+17
source share

So, I recently had a very similar problem, unfortunately, uninstalling and reinstalling did not work. Hope this helps anyone, as it is very frustrating.

Steps:

  • Go or launch the quick launch function.
  • package manager type
  • select "tools-> Nuget PackageManager-> Package Manager Settings"
  • In the appeared options window. Click Clear All Nudget Caching.
  • Right-click and select Restore Nuget Packages.

Hope this helps.

+2
source share

Something I just noticed, and I'm not sure if this will help you or anyone else reading this, but this problem literally hit my brain. The problem was that I installed the packages I created using the NuGet Package Explorer on Windows.

It turned out that after updating the NuGet Package Explorer, it no longer puts the DLLs that I included in the lib folder. As soon as I started manually adding the lib folder back to the package in Package Explorer, and then loading it into NuGet and reinstalling it in the consuming project, this link will start to appear again.

I'm not sure what caused this behavior - it could be my own mistake, but I literally just figured it out - and therefore have to go back and re-do the whole bunch of NuGet package good that I did over the past month.

Hope this saves someone from at least an ounce of pain.

+2
source share

I ran into a problem with the NuGet Newtonsoft.Json package as shown below:

enter image description here

I tried all possible solutions, but none of the following worked:

  • Cleaning solution
  • Recovery solution
  • Clear NuGet Package Cache

Finally, I realized that this had something to do with the version of the .NET Framework that my C # project is targeting. There seems to be some kind of inconsistency. At that moment, when I updated the version of my .NET Framework project to the latest, the dependency of the Newtonsoft.Json package and its link instantly came to life.

+1
source share

None of the above helped me.

What worked was to edit the project file directly and delete the existing link. When I reloaded the project, the package appeared in links as a Nuget package.

0
source share

All Articles