8

I've migrated away from the MSBuild package restore to the automatic package restore which restores packages before the builds begins. (http://docs.nuget.org/docs/workflows/migrating-to-automatic-package-restore)

According to this article http://docs.nuget.org/docs/reference/package-restore-with-team-build TFS 2013 and Visual Studio Online don't need any special configuration, but I've opened up the xaml process templates and they do not implement the NuGetRestore activity. As you can see it's available for use, but I can't find any articles on how to implement it properly.

enter image description here

I've checked all of these templates enter image description here

The Muffin Man
  • 19,585
  • 30
  • 119
  • 191

1 Answers1

5

The TfvcTemplate.12.xaml makes use of a build activity which generates the nuget restore action on the fly. Therefore you don't see it in the workflow.

Rolf Huisman
  • 1,417
  • 8
  • 17
  • Currenly there is an issue with nuget restore not working properly if the "old" nuget with the target file restore is still present. Might be your issue. – Rolf Huisman Jul 23 '14 at 15:40
  • After implementing that template, it doesn't work. Set verbosity on the MSBuild activity to diagnostic and don't see any reference to calling nuget.exe. I wonder how we can know whether it's actually doing it? – dudeNumber4 Aug 06 '14 at 12:55
  • After much investigation it turns out that the restore is happening, but my solutions won't build because a "HintPath" is added to a project file when packages are restored. For any project shared between multiple solutions, this path will be in source control as the correct path whenever it was last restored. On dev machines where all code hangs around, multiple solutions continue working. On the build machine, they'll never build for all solutions. – dudeNumber4 Aug 06 '14 at 15:51
  • @dudeNumber4 Do you have a solution to the HintPath? I ultimately gave up and checkin all of my nuget packages into source control (ugh), but I spent a lot of time trying to get this to work with no luck. – The Muffin Man Nov 19 '14 at 20:24
  • @TheMuffinMan 2 of us spent *days* on this before un-hooking nuget for this solution. We're referencing the .dlls the old fashioned way. – dudeNumber4 Nov 19 '14 at 22:25
  • The only working solution for hint paths i have seen with companies is either not using them or use company wide policies how the directory is mapped locally. – Rolf Huisman Nov 28 '14 at 09:57
  • 1
    I too am having issues with this. The build activity mentioned above is "Run MSBuild" and it's passed a parameter called "RestoreNuGetPackages" which in the template is set to "True". – gmasselli Mar 25 '15 at 15:04
  • @TheMuffinMan There is a script called `FixHintPaths.ps1` that fixes that problem here: https://github.com/owen2/AutomaticPackageRestoreMigrationScript – Micteu Aug 14 '15 at 18:19
  • Does nuget package restore work with the AzureContinuousDeployment xaml fil? – TWilly Nov 04 '15 at 22:50