Peter Sun
Peter Sun

Reputation: 1813

VS 2017 - Missing NuGet Package from an old solution project

I am working on an old project that was given to me. When I try to build, I get the following error:

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. The missing file is ..\packages\WinSCP.5.13.0\build\WinSCP.targets.   App1.App.Export C:\Visual_Studio\App1.App.Export\App1.App.Export\App1.App.Export.csproj
  1. I looked at the NuGet Settings and it is set to download automatically any missing Nuget Packages.
  2. I also tried removing and re-installing the missing package in the NuGet Manager.
  3. Clean the build and rebuilt the project.
  4. Right-clicked on the Solution and selected 'Restore NuGet Packages

What other methods should I try?

Upvotes: 0

Views: 396

Answers (1)

Mr Qian
Mr Qian

Reputation: 23760

It seems that you have missed the nuget package WinSCP 5.13.0.

Please try these stpes:

First of all, the package exists under nuget.org, so you should make sure that the nuget.org is under your nuget package source and the checkbox is checked.

enter image description here

1) clean nuget caches first or delete all files under C:\Users\xxx(current user)\.nuget\packages.

Also, delete bin and obj folder.

2) close VS, delete nuget.config file under C:\Users\xxx\AppData\Roaming\NuGet.

Then, reopen your project, run update-package -reinstall under Tools-->Nuget Package Manager-->Package Manager Console.

3) If it still cannot work, please try to create a new project and then install WinSCP 5.13.0 nuget package to see whether it works.

Also, share the whole csproj file with us so that it will help us troubleshoot the issue more quickly.

Upvotes: 1

Related Questions