3

I created an app that builds all the solutions I have using the Build API (https://msdn.microsoft.com/en-us/library/dn715758(v=vs.121).aspx).

The problem I am facing, is that it does not trigger the nuget package restore. Which means that if it's the first time someone is building the source code, or a package has been updated by someone else, it does not automatically update/trigger the package restore on build.

Can't find anything in the documentation, maybe someone else knows something?

Johan
  • 8,068
  • 1
  • 33
  • 46

2 Answers2

1

In the solution explorer (where you see your solution and all projections) right click on the solution, not on the project.

In the context menu you'll see

Enable Nuget Package Restore

Harald Coppoolse
  • 28,834
  • 7
  • 67
  • 116
  • This is already the case, yet building it doesn't restore the packages.. (using the Build API). – Johan Aug 10 '15 at 13:28
0

I believe you will have to execute the restore command separately.

https://docs.nuget.org/consume/command-line-reference#restore-command

Flea
  • 1,490
  • 2
  • 19
  • 43
  • 1
    This doesn't seem right, surely the Build API must have something, do you have a source that states you need to run the restore separately? – Johan Aug 10 '15 at 13:29
  • nuget isn't part of msbuild, it's a msbuild task located in your soltuion folder under `.nuget/nuget.target` if you are building the .sln file with msbuild ( and you have nuget package restore enabled) the target should triget and restore the packages. – Nikola Sivkov Aug 10 '15 at 13:40
  • if it's not trigering, consider doing package restore manually via the `.nuget/nuget.exe` provided – Nikola Sivkov Aug 10 '15 at 13:41