If you are not able to run lab workflow (or BDT which we call it internally) when 2013 components (VS) and 2012 components (read BA/BC/VS) are installed on the same machine, then please read on. There is a known issue here and this post talks about how you can verify that you are running into the same issue or not and secondly how you can come out of it.

If you are running into the same issue, then you will observe that the workflow fails with an error similar to the one mentioned below.

TF215097: An error occurred while initializing a build for build definition \MyProject\MyBuildDefinition: Exception Message: The root element of the build process template found at $/MyProject/BuildProcessTemplates/LabDefaultTemplate.11.xaml (version C62) is not valid. (The build process failed validation. Details: Validation Error: The private implementation of activity '1: DynamicActivity' has the following validation error: Compiler error(s) encountered processing expression "Not String.Equals(Microsoft.TeamFoundation.Lab.Client.LabEnvironment.UnmanagedProvider, labEnvironment.LabProvider)".Type 'LabEnvironment' is not defined.Validation Error: The private implementation of activity '1: DynamicActivity' has the following validation error: Compiler error(s) encountered processing expression "Not String.Equals(Microsoft.TeamFoundation.Lab.Client.LabEnvironment.UnmanagedProvider, labEnvironment.LabProvider)".Type 'LabEnvironment' is not defined.) (type Exception)Exception Stack Trace: at Microsoft.TeamFoundation.Build.Hosting.BuildControllerWorkflowManager.PrepareRequestForBuild(WorkflowManagerActivity activity, IBuildDetail build, WorkflowRequest request, IDictionary`2 dataContext) at Microsoft.TeamFoundation.Build.Hosting.BuildWorkflowManager.TryStartWorkflow(WorkflowRequest request, WorkflowManagerActivity activity, BuildWorkflowInstance& workflowInstance, Exception& error, Boolean& syncLockTaken)

If you are running into the same problem, then you can fix it by either using the attached lab default template file or by making the following changes in your template file (named LabDefaultTemplate.11.xaml).

  • Remove the following statement (pre-removal, there should be only one occurrence of this line and post-removal there should be none).

xmlns:mtltc="clr-namespace:Microsoft.TeamFoundation.Lab.TestIntegration.Client;assembly=Microsoft.TeamFoundation.Lab.TestIntegration.Client"

  • Remove the following statement (pre-removal, there should be only one occurrence of this line and post-removal there should be none).

xmlns:mtlwc="clr-namespace:Microsoft.TeamFoundation.Lab.WorkflowIntegration.Client;assembly=Microsoft.TeamFoundation.Lab.WorkflowIntegration.Client"

  • Remove the following statement (pre-removal, there should be only one occurrence of this line and post-removal there should be none).

<Variable x:TypeArguments="mtltc:TestingCapabilityInformation" Name="TestCapabilityInfo" />

  • Restart the tfs build service (net stop TfsBuildServiceHost.2012 and net start TfsBuildServiceHost.2012).

After this the lab workflow will run perfectly fine.

Enjoy !!