Rajasekhar Pasalapudi
Rajasekhar Pasalapudi

Reputation: 91

Fix error "Cannot determine the packages folder to restore NuGet packages"

I'm getting the following error during the Azure Cloud Build process. How can I fix the problem?

"##[error]Cannot determine the packages folder to restore NuGet packages. Please specify either -PackagesDirectory or -SolutionDirectory."

Upvotes: 9

Views: 7208

Answers (2)

Mr.Z
Mr.Z

Reputation: 659

I ran into this error verbatim after running nuget.exe restore on a project that didn't actually reference any NuGet packages, however, within the project's directory sat a packages.config file containing an entry to a package. This config file was not included or referenced by the project, it was just sitting in the directory.

Deleting the stray packages.config file resolved the error.

Upvotes: 3

Leo Liu
Leo Liu

Reputation: 76920

Just like the build log said, you should give a argument the -PackagesDirectory or -SolutionDirectory to specify a folder to store the packages.

Check the restore options for more details.

Hope this helps.

Upvotes: -2

Related Questions