简体   繁体   中英

Running pre-build scripts in Visual Studio Team Services for Azure Continuous Deployment build process

My goal is to update the AssemblyInfo.cs version information in my project with a version number that is derived from the build definition / build number that is generated by TFS. For example, the first build that runs on 2013-01-20 would be 2013.1.2.1 .

Further, I am using the Microsoft hosted TFS (now known as Visual Studio Team Services), and am using the AzureContinuousDeployment.11.xaml build process. This was automatically setup when I linked Azure to TFS.

Information from http://msdn.microsoft.com/en-us/library/vstudio/dn376353.aspx#scripts implies that I can run a Powershell script as a pre-build task, and I'd like to use the one from https://tfsbuildextensions.codeplex.com/SourceControl/latest#Scripts/ApplyVersionToAssemblies.ps1

However, I don't see the Pre-Build Script options available for my given build definition.

Is this a limitation of the Visual Studio Team Services, the particular build process or is there something that I am missing to enable or make visible these options?

I'd like to be able to apply the version in the easiest way possible (ie without modifying the build process if possible).

If you don't require the AzureContinuousDeployment.11.xaml build process template you could change it to the TfvcTemplate.12.xaml build process template which does include the Pre-Build Script options you're after.

在此处输入图片说明

The recommended approach is to customize the build template (AzureContinuousDeployement.11.xaml) and add in the custom TFSVersion activity from the TFS Community Build Extensions that will handle this.

If you've never customized a TFS Build Template before you can learn about the process in the ALM Rangers Build Guidance

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM