-2

When Nuget 2.7 was introduced; a new Automatic Package Restore feature came along with it. The gist: You no longer need to have Nuget.exe, nuget.targets, or the packages folder checked in to source. Instead, simply be enabling automatic package restore in Visual Studio's Package Manager Settings; and ensuring that the nuget.config has disabled source control integration is all you need.

For Team Foundation Server 2013, the Build process templates were updated to use this Automatic Package Restore Functionality:

Turns out that on prem Team Build (starting with TFS 2013) also supports automatic package restore. For TFS 2013 you don't need to configure anything when creating new builds. For builds that were created with older version of TFS you'll need to update the build process template.

We're using an older Build Process Template; but I can't seem to find the exact part of the XAML responsible for nuget package restore. Since I can't find it, I can't add it to 'upgrade' the build template. This seems to be a common issue.

How do I upgrade a Build Template that was created with Team Foundation Server 2012 to use the new Automatic Package Restore Feature available to TFS 2013?

Community
  • 1
  • 1
George Stocker
  • 57,289
  • 29
  • 176
  • 237

1 Answers1

1

You can just change the template. If you open the build definition and go to the Process tab you should see your xaml template specified at the top of the configuration screen.

Hit the down arrow then change the drop-down to select TfvcTemplate.12.xaml.

You can then re-add your customizations to the new template that has the new features.

  • That upgrades a build definition not a build template – rob Mar 06 '15 at 11:51
  • You should switch to the updated template and re-add your customizations. I would also take the opportunity to move my customizations over to PowerShell... – MrHinsh - Martin Hinshelwood Mar 06 '15 at 13:38
  • I should note that I couldn't find anywhere in the .xaml file that had anything to with package restore; and it was a custom template, so 'just changing the template' would mean I'd need to re-add all the customizations back end (which is what I ended up doing). – George Stocker Sep 04 '15 at 00:29
  • 1
    It is a bad practice to customise the xaml template. You should redo your customisations as PowerShell and add the resulting scripts into the provided slots for execution... – MrHinsh - Martin Hinshelwood Sep 07 '15 at 12:22