3
votes

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
Does the new computer have the latest version of NuGet? Also, there have been some changes to the .csproj file format over the years, so it might be helpful to know which version of Visual Studio the project was created in, and whether it's .NET Core, .NET Standard, or .NET Framework. - Joe White
Any update for this issue? Have you resolved this issue? If not, would you please let me know the latest information about this issue? - Leo Liu-MSFT
Yes, I did not end up figuring out why exactly this was happening, but I just decided to try copying my solution to a different location again and the second time it worked fine. As it is working fine now I am not looking further into what went wrong - Casey Daly

2 Answers

2
votes

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.

0
votes

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