Visual Studio 2015 Update 1 and XAML build templates
Asked Answered
T

1

10

So I am going to ask my original question, but then answer it because I found a solution.

Since I recently upgraded my dev box from VS 2015 to VS 2015 Update 1, my custom XAML template encountered an error that I didn't seem to cause. I was wondering why?

The build exception most may be seeing and I saw: Cannot set unknown member 'Microsoft.TeamFoundation.Build.Activities.RunScript.FailOnNonZeroExitCode'(type XamlObjectWriterException)

Tuckerbag answered 27/1, 2016 at 16:57 Comment(2)
Cool of you to share a problem + solution with the community, +1 man, welcome to SO.Anselmo
Thanks! I hate it when Microsoft sneaks stuff in like this and we find out at the most convenient times (week of app delivery).Tuckerbag
T
21

Turns out Microsoft made some sort of schema change in VS 2015 update 1 that adds a property to what I experienced as 4 lines in the XAML that will break the automatic build templates if running a VS 2015 build controller and agent(s). Not sure if the build controller can be updated yet to match, but here is what I found in the two XAMLs:

Good with no extra property:

<mtba:RunScript Arguments="[AdvancedBuildSettings.GetValue(Of String)(&quot;PreActionScriptArguments&quot;, String.Empty)]" DisplayName="Run optional script before MSBuild" Enabled="True" FilePath="[AdvancedBuildSettings.GetValue(Of String)(&quot;PreActionScriptPath&quot;, String.Empty)]" sap2010:WorkflowViewState.IdRef="RunScript_1" />
<mtba:RunScript Arguments="[AdvancedBuildSettings.GetValue(Of String)(&quot;PostActionScriptArguments&quot;, String.Empty)]" DisplayName="Run optional script after MSBuild" Enabled="True" FilePath="[AdvancedBuildSettings.GetValue(Of String)(&quot;PostActionScriptPath&quot;, String.Empty)]" sap2010:WorkflowViewState.IdRef="RunScript_2" />
<mtba:RunScript Arguments="[AdvancedTestSettings.GetValue(Of String)(&quot;PreActionScriptArguments&quot;, String.Empty)]" DisplayName="Run optional script before Test Runner" Enabled="True" FilePath="[AdvancedTestSettings.GetValue(Of String)(&quot;PreActionScriptPath&quot;, String.Empty)]" sap2010:WorkflowViewState.IdRef="RunScript_3" />
<mtba:RunScript Arguments="[AdvancedTestSettings.GetValue(Of String)(&quot;PostActionScriptArguments&quot;, String.Empty)]" DisplayName="Run optional script after Test Runner" Enabled="True" FilePath="[AdvancedTestSettings.GetValue(Of String)(&quot;PostActionScriptPath&quot;, String.Empty)]" sap2010:WorkflowViewState.IdRef="RunScript_4" />

Changed schema using Update 1 (same 4 lines of code):

<mtba:RunScript Arguments="[AdvancedBuildSettings.GetValue(Of String)(&quot;PreActionScriptArguments&quot;, String.Empty)]" DisplayName="Run optional script before MSBuild" Enabled="True" FailOnNonZeroExitCode="True" FilePath="[AdvancedBuildSettings.GetValue(Of String)(&quot;PreActionScriptPath&quot;, String.Empty)]" sap2010:WorkflowViewState.IdRef="RunScript_1" />
<mtba:RunScript Arguments="[AdvancedBuildSettings.GetValue(Of String)(&quot;PostActionScriptArguments&quot;, String.Empty)]" DisplayName="Run optional script after MSBuild" Enabled="True" FailOnNonZeroExitCode="True" FilePath="[AdvancedBuildSettings.GetValue(Of String)(&quot;PostActionScriptPath&quot;, String.Empty)]" sap2010:WorkflowViewState.IdRef="RunScript_2" />
<mtba:RunScript Arguments="[AdvancedTestSettings.GetValue(Of String)(&quot;PreActionScriptArguments&quot;, String.Empty)]" DisplayName="Run optional script before Test Runner" Enabled="True" FailOnNonZeroExitCode="True" FilePath="[AdvancedTestSettings.GetValue(Of String)(&quot;PreActionScriptPath&quot;, String.Empty)]" sap2010:WorkflowViewState.IdRef="RunScript_3" />
<mtba:RunScript Arguments="[AdvancedTestSettings.GetValue(Of String)(&quot;PostActionScriptArguments&quot;, String.Empty)]" DisplayName="Run optional script after Test Runner" Enabled="True" FailOnNonZeroExitCode="True" FilePath="[AdvancedTestSettings.GetValue(Of String)(&quot;PostActionScriptPath&quot;, String.Empty)]" sap2010:WorkflowViewState.IdRef="RunScript_4" />

Workaround/hack if you don't/can't update build controller:

  1. Make your changes to the templates and save them.
  2. Remove the 4 properties in the above lines: FailOnNonZeroExitCode="True"
  3. Save without making further changes to XAML.
  4. Repeat process if another change is needed.

I will be testing to see if I can update our build controller to update 1 to see if it permanently fixes this issue and post back.

Tuckerbag answered 27/1, 2016 at 17:5 Comment(3)
I owe you beer! ;)Rameses
+1 This didn't solve my problem, but led me to the solution. VS 2015 added some cruft to my TFS 2013 XAML build template (probably shouldn't be doing that anyway).Moonrise
I own you another :)Vulgar

© 2022 - 2024 — McMap. All rights reserved.