所以我要问我最初的问题,然后回答它,因为我找到了解决方案。
由于我最近将开发盒从 VS 2015 升级到 VS 2015 Update 1,因此我的自定义 XAML 模板遇到了一个我似乎没有引起的错误。我想知道为什么?
大多数可能会看到的构建异常,我看到了:无法设置未知成员 'Microsoft.TeamFoundation.Build.Activities.RunScript.FailOnNonZeroExitCode'(type XamlObjectWriterException)
所以我要问我最初的问题,然后回答它,因为我找到了解决方案。
由于我最近将开发盒从 VS 2015 升级到 VS 2015 Update 1,因此我的自定义 XAML 模板遇到了一个我似乎没有引起的错误。我想知道为什么?
大多数可能会看到的构建异常,我看到了:无法设置未知成员 'Microsoft.TeamFoundation.Build.Activities.RunScript.FailOnNonZeroExitCode'(type XamlObjectWriterException)
事实证明,微软在 VS 2015 更新 1 中进行了某种架构更改,为我在 XAML 中经历的 4 行添加了一个属性,如果运行 VS 2015 构建控制器和代理,这将破坏自动构建模板。不确定是否可以更新构建控制器以匹配,但这是我在两个 XAML 中找到的内容:
很好,没有额外的属性:
<mtba:RunScript Arguments="[AdvancedBuildSettings.GetValue(Of String)("PreActionScriptArguments", String.Empty)]" DisplayName="Run optional script before MSBuild" Enabled="True" FilePath="[AdvancedBuildSettings.GetValue(Of String)("PreActionScriptPath", String.Empty)]" sap2010:WorkflowViewState.IdRef="RunScript_1" />
<mtba:RunScript Arguments="[AdvancedBuildSettings.GetValue(Of String)("PostActionScriptArguments", String.Empty)]" DisplayName="Run optional script after MSBuild" Enabled="True" FilePath="[AdvancedBuildSettings.GetValue(Of String)("PostActionScriptPath", String.Empty)]" sap2010:WorkflowViewState.IdRef="RunScript_2" />
<mtba:RunScript Arguments="[AdvancedTestSettings.GetValue(Of String)("PreActionScriptArguments", String.Empty)]" DisplayName="Run optional script before Test Runner" Enabled="True" FilePath="[AdvancedTestSettings.GetValue(Of String)("PreActionScriptPath", String.Empty)]" sap2010:WorkflowViewState.IdRef="RunScript_3" />
<mtba:RunScript Arguments="[AdvancedTestSettings.GetValue(Of String)("PostActionScriptArguments", String.Empty)]" DisplayName="Run optional script after Test Runner" Enabled="True" FilePath="[AdvancedTestSettings.GetValue(Of String)("PostActionScriptPath", String.Empty)]" sap2010:WorkflowViewState.IdRef="RunScript_4" />
使用更新 1 更改了架构(相同的 4 行代码):
<mtba:RunScript Arguments="[AdvancedBuildSettings.GetValue(Of String)("PreActionScriptArguments", String.Empty)]" DisplayName="Run optional script before MSBuild" Enabled="True" FailOnNonZeroExitCode="True" FilePath="[AdvancedBuildSettings.GetValue(Of String)("PreActionScriptPath", String.Empty)]" sap2010:WorkflowViewState.IdRef="RunScript_1" />
<mtba:RunScript Arguments="[AdvancedBuildSettings.GetValue(Of String)("PostActionScriptArguments", String.Empty)]" DisplayName="Run optional script after MSBuild" Enabled="True" FailOnNonZeroExitCode="True" FilePath="[AdvancedBuildSettings.GetValue(Of String)("PostActionScriptPath", String.Empty)]" sap2010:WorkflowViewState.IdRef="RunScript_2" />
<mtba:RunScript Arguments="[AdvancedTestSettings.GetValue(Of String)("PreActionScriptArguments", String.Empty)]" DisplayName="Run optional script before Test Runner" Enabled="True" FailOnNonZeroExitCode="True" FilePath="[AdvancedTestSettings.GetValue(Of String)("PreActionScriptPath", String.Empty)]" sap2010:WorkflowViewState.IdRef="RunScript_3" />
<mtba:RunScript Arguments="[AdvancedTestSettings.GetValue(Of String)("PostActionScriptArguments", String.Empty)]" DisplayName="Run optional script after Test Runner" Enabled="True" FailOnNonZeroExitCode="True" FilePath="[AdvancedTestSettings.GetValue(Of String)("PostActionScriptPath", String.Empty)]" sap2010:WorkflowViewState.IdRef="RunScript_4" />
如果您不/无法更新构建控制器,解决方法/破解:
我将测试是否可以更新我们的构建控制器以更新 1 以查看它是否永久修复此问题并回发。