Visual Studio Test Runner not an option for TFS 2012 Build Definition ?

Recently I noticed that Visual Studio Test Runner option was missing while modifying a build definition.

To fix this, I compared this with 2012 DefaultTemplate.11.1.xaml. There were sequences and Arguments missing because of which Visual Studio Test Runner option was missing.

These are the modification that I made to the template to get back VsTestRunner:

1. Compare the template with DefaultTemplate.11.1.xaml.


  In my case, “Try Run Tests” section had only “If spec Is TestMetadata FileSpec” sequence. The “If spec Is AgileTestPlatformSpec” along with “Run Visual Studio Test Run” was missing. I added this whole section to my template.

 2. In the Argument section, add a new string Property “BuildProcessVersion” and assign “11.0” as value.



3. Check-in the template and refresh “Build process template” in Process tab of the build definition. Editing the test should now show the “Visual Studio Test Runner” option.



Hope this helps!