LabDefaultTemplate.xaml fails when VS 2013 is installed on a 2012 build Agent.
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 !!
Comments
- Anonymous
October 13, 2014
I used your attached template to fix the issue. Thanks for the write up. - Anonymous
January 22, 2015
Thanks so much. I first tried the template but that didn't fix my issue. Then I tried removing the lines you specified above in my workflow template. That worked! I got past the original problem I had. Thanks so much for posting. Here was my original error:TF215097: An error occurred while initializing a build for build definition Workflow:Exception Message: The root element of the build process template found at $/Project/Main/BuildProcessTemplates/LabDefaultTemplate.11_2.xaml (version C2196) 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. - Anonymous
January 22, 2015
Good to know that you were able to get past the issue. - Anonymous
June 02, 2015
Didn't work for me, I added version (, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a) number info to the references; xmlns:mtltc="clr-namespace:Microsoft.TeamFoundation.Lab.TestIntegration.Client;assembly=Microsoft.TeamFoundation.Lab.TestIntegration.Client" became xmlns:mtltc="clr-namespace:Microsoft.TeamFoundation.Lab.TestIntegration.Client;assembly=Microsoft.TeamFoundation.Lab.TestIntegration.Clien, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3at" I did this for all Microsoft.TeamFoundation references.