Strange TFS build process template editing issue with Typemock
Had a strange issue today while editing our standard TFS 2013 XAML build process template to add an optional post drop script block to allow a Release Management pipeline to be triggered via REST. Our standard template includes a block for enabling and disabling Typemock, after editing our template to add the new script block (nowhere near the Typemock section) our builds failed with the error
1TF215097: An error occurred while initializing a build for build definition BMISS.Expenses.Main.CI: Exception Message: Cannot set unknown member 'TypeMock.TFS2013.TypeMockStart.DisableAutoLink'. (type XamlObjectWriterException) Exception Stack Trace: at System.Xaml.XamlObjectWriter.WriteStartMember(XamlMember property)
It took ages to find the issue, we hunted for badly formed XAML, but the issue turned out to be that when ever we opened the template in Visual Studio 2013 it added the highlighted property
1<If Condition="\[UseTypemock = True\]" DisplayName="If using Typemock" sap2010:WorkflowViewState.IdRef="If\_8">
2 <If.Then>
3 <Sequence DisplayName="Enabling Typemock" sap2010:WorkflowViewState.IdRef="Sequence\_16">
4 <tt:TypeMockRegister AutoDeployDir="\[TypemockAutoDeployDir\]" Company="\[TypemockCompany\]" sap2010:WorkflowViewState.IdRef="TypeMockRegister\_1" License="\[TypemockLicense\]" />
5 <tt:TypeMockStart DisableAutoLink="{x:Null}" EvaluationFolder="{x:Null}" Link="{x:Null}" LogLevel="{x:Null}" LogPath="{x:Null}" ProfilerLaunchedFirst="{x:Null}" Target="{x:Null}" Verbosity="{x:Null}" Version="{x:Null}" AutoDeployDir="\[TypemockAutoDeployDir\]" sap2010:WorkflowViewState.IdRef="TypeMockStart\_1" />
6 </Sequence>
7 </If.Then>
8</If>
It should have been
1<If Condition="\[UseTypemock = True\]" DisplayName="If using Typemock" sap2010:WorkflowViewState.IdRef="If\_8">
2 <If.Then>
3 <Sequence DisplayName="Enabling Typemock" sap2010:WorkflowViewState.IdRef="Sequence\_16">
4 <tt:TypeMockRegister AutoDeployDir="\[TypemockAutoDeployDir\]" Company="\[TypemockCompany\]" sap2010:WorkflowViewState.IdRef="TypeMockRegister\_1" License="\[TypemockLicense\]" />
5 <tt:TypeMockStart EvaluationFolder="{x:Null}" Link="{x:Null}" LogLevel="{x:Null}" LogPath="{x:Null}" ProfilerLaunchedFirst="{x:Null}" Target="{x:Null}" Verbosity="{x:Null}" Version="{x:Null}" AutoDeployDir="\[TypemockAutoDeployDir\]" sap2010:WorkflowViewState.IdRef="TypeMockStart\_1" />
6 </Sequence>
7 </If.Then>
8</If>
All I can assume is that this is due to some assembly mismatch between the Typemock DLLs linked to the XAML build process template and those on my development PC.
The fix for now is to do the editing in a text editor, or at least checking the file to make sure the property has not been edited before it is checked in.