07Apr

TFS 2013 Build Template Customization

How to enable logging verbosity process parameter in build definition?

Verbosity for a build will help us to debug the build results to see what exactly went into build. In TFS 2013, default build process template TfvcTemplate.12.xaml verbosity level is set to “Normal” by default and if we need to change the verbosity level we have to download and open the template and set the Verbosity property value of RunMsBuild activity to Detailed or Diagnostic or Minimal (Figure 1.1) and then check-in to TFS and then upload it to build.

Figure 1.1

Figure 1.1

But this change will be applicable for all the build definitions which makes use of this build template. So we cannot maintain different verbosity levels for all build definitions. And if we observe the default build process template (TfvcTemplate.12.xaml) of TFS 2013, we will not find the logging verbosity parameter to set it to Minimal, Normal, Detailed or Diagnostic. (This option is available in TFS 2012 or TFS 2010 build templates by default). So let’s see how to achieve this by little customization to the template.

Steps to enable the logging Verbosity parameter in Build definition process tab.

  1. Download the template TfvcTemplate.12.xaml from build definition wizard and add it to the version control folder.
  2. Now open this file in Visual Studio and you can see the workflow defined for TfvcTemplate.12.xaml template. Click on Arguments tab down the page and create new argument called Verbosity.
  3. Let the argument Direction be “In” and change argument type to “Microsoft.TeamFoundation.Build.Workflow.BuildVerbosity”. And set Default value as “Microsoft.TeamFoundation.Build.Workflow.BuildVerbosity.Normal” as shown in Figure 1.2.

Figure 1.2

Figure 1.2

  1. This completes defining the build argument and setting its default value. Now let’s make this argument be available in build definition Process Tab. For this, click on Metadata argument in the argument tab and click on the ellipses (…) button under default value column of Metadata argument as shown in Figure 1.3. This will open “Process Parameter Metadata Editor” window as shown in Figure 1.4

Figure 1.3

Figure 1.3

Figure 1.4

Figure 1.4

  1. In “Process Parameter Metadata Editor” window we can add the parameter that has to be appear in build definition process parameters Figure 1.5.

Figure 1.5

Figure 1.5

  1. Let us add the parameter Logging verbosity parameter under category 2. Build after 5. Advanced parameter i.e. 6. Logging verbosity.

To do this, open” Process Parameter Metadata Editor” and make note of parameter ProjectsToBuild, because we are adding parameter under same category. Image 1.5, in our template category value is #200 Build

Figure 1.6

Figure 1.6

Now click on Add button and give following details as shown in Figure 1.7..

Parameter Name

Verbosity

Display Name 

6. Logging verbosity

Category

#200 Build

Description

Specify the level of logging desired for this build. Higher verbosity levels will typically result in slower builds.

Value Format String

Microsoft.TeamFoundation.Build.Workflow.BuildVerbosity

View this parameter when

Always show the parameter

  1. Where Parameter Name should be same as argument name defined (Step 2), Display Name depends on how you want to display this parameter in build definition, Category under which category you want to display the parameter, Description explains the parameter in build definition and View this parameter when for enabling this parameter either only in build definition or only when queuing the build or both in definition and queuing the build or never.

Figure 1.7

Figure 1.7

  1. After entering the details click ok and save the changes then check-in the template to Source Control. Use this customized template in build definition and you will be able to see the new parameter logging verbosity as shown in Figure 1.8, or while queuing you can edit this verbosity value in queue build parameter window as shown in Figure 1.9

Figure 1.8

Figure 1.8

Figure 1.9

Figure 1.9

Thank you for reading this blog post, your comments are always welcome.

 

Related

How to Prevent Users from Moving Task to Closed State with a non-Zero value Remaining Work field in VSTS/TFS

In this Blog I am going to explain how we can customize Task in VSTS/TFS to Prevent Users from Movin...

Read More >

Dashboard Migrator Tool

This is a web service which helps you to copy the VSTS dashboards from 1 team to another team easing...

Read More >

Canarys Automations Pvt Ltd recognized as finalist for 2017 Microsoft DevOps Partner of the Year Award

  Bengaluru, Karnataka, India — June 2, 2017 — Canarys Automations Pvt Ltd tod...

Read More >

Bugzilla to TFS Migrator (Part 2 of 4) – Installation

This is the second part of the Bugzilla to TFS Migrator blog series covering the installation of the...

Read More >

Bugzilla to TFS Migrator (Part 3 of 4) – Configuration

This is the third part of the Bugzilla to TFS Migrator blog series covering the configuration of the...

Read More >

Bugzilla to TFS Migrator (Part 4 of 4) - Migration

This is the final part of the Bugzilla to TFS Migrator blog series covering the actual steps of migr...

Read More >

Automating .NET builds using CCNET and TFS

CruiseControl.NET (CCNET) is an open source tool used for continuous builds on server, where testing...

Read More >

Migrating TFS 2013 Version Control to TFS Git with changeset history

There are several articles on the web describing the migration technique with minimal details. This ...

Read More >

TFS Build for .Net 2.0 Projects

Clients have strange requirements. The other day I had been to a client for a discussion. These guys...

Read More >

Share

Post a Comment

  • Recent
  • Popular
  • Tag
Tags
Monthly Archive
Subscribe
Name

Contact Us
  • *
  • *