Missing NuGet Packages, But "Packages Already Installed"

4.6k Views Asked by At

I have seen this same problem brought up by numerous people online, and have tried just about everything under the sun to resolve this issue but nothing is working. I copied my visual studio solution to another location on my computer, and now when I try to build it I get the infamous...

This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105.

Of course, I've enabled package restoration, tried restoring them manually (in which case I get a message saying "All packages are already installed and there is nothing to restore."), I've tried deleting all packages and then having the project restore them, I've read a lot about maybe the issue being the .csproj file, could that be it? If so, how do I access this file? Seems very rudimentary but for some reason I can't find it in my solution.

2

There are 2 best solutions below

1
On

The thread is quite old but for someone coming back. Make sure to delete the bin and object folder and rebuild the project.

1
On

Missing NuGet Packages, But “Packages Already Installed”

NuGet will check the packages directory for the solution when it restores.

It checks that this packages directory contains the .nupkg and manifest file for the NuGet package and if so it believes the NuGet package is already installed locally.

So, to resolve the issue "Missing NuGet Packages, But Packages Already Installed", you can try the following troubleshootings:

  1. Make sure you are not add the \packages folder in to source control, like TFS. If yes, please try to remove it out of source control.

  2. Make sure you are not change the .csproj file to another location. If yes, please edit the .csproj file and correcting the relative path to the solution folder.

  3. Remove the package folders and their contents from the packages directory, then try again.

If above not help, please try to share the restore log to us, I will check it and update my answer.

Hope this helps.