1
votes

I'm getting this error when building a project​ using Visual Studio online service build:

Error:

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

It is giving that nuget.target file is missing but it is already present in .nuget folder.

Any help?

2
@Dipali: please use only code ticks for words that are code, and not for anything else concerning software or code. Also, please do not randomly bold phrases (as you did in some of your other edits). They do not "improve formatting". – Jongware

2 Answers

1
votes

You should add a "Nuget Package Restore" task to your build before you run your compilation. You no longer need a ".nuget" folder.

0
votes

I had a different cause, in VSTS/Azure DevOps using "Use Nuget" first then "NuGet restore" second, on Hosted agent...the restore was throwing this error. Error began showing sometime around Feb 1, 2019.

I had to change this...

Path to solution, packages.config, or project.json: **/*.sln

to this...

Path to solution, packages.config, or project.json: **\{YOUR_SOLUTION_NAME}.sln

And the error went away.

Hope this helps!