gpt4 book ai didi

tfs - 项目中多个构建模板(xaml 文件)的问题

转载 作者:行者123 更新时间:2023-12-04 10:26:34 25 4
gpt4 key购买 nike

我的 TFS Build 项目有问题。我正在遵循 here 中的示例至于在VS中设置项目。

我有一个仅用于自定义事件的项目和一个仅用于模板的单独项目。我的问题是模板项目只能包含一个 xaml 文件。如果我将它复制并粘贴到同一个项目中,它就不会构建。我收到以下错误:

错误 102 在“Resources”参数中多次指定了项目“obj\Debug\TfsBuild_Process_BeforeInitializeComponentHelper.txt”。 “Resources”参数不支持重复项。

但是,如果我将其删除,它将构建得很好。一切正常,这意味着如果我排队构建它就会构建。

我也尝试了 here 上建议的解决方案,但它似乎并没有解决我的问题。

Solution:

Renaming the form name in the solution explorer.

Change the class name in the .cs and Designer.cs file.

Change the constructor and destructor name (which is same as class name)

Change the name space name (if needed).



Here是下载项目的链接。

我似乎无法弄清楚为什么。任何帮助是极大的赞赏!

最佳答案

我不知道你是否还有这个问题,但我今天也遇到了这个问题。我找到了一个解决方案(如果您仍然面临问题)可以帮助您或其他人。

当您复制构建过程模板时,它会自动将 x:Class 属性设置为 TfsBuild.Process .当您有多个具有相同值的流程模板时,您将在构建项目时收到此错误。

<Activity mc:Ignorable="sads sap sap2010" x:Class="TfsBuild.Process" this:Process.BuildNumberFormat="$(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.r)" this:Process.AgentSettings="[New Microsoft.TeamFoundation.Build.Workflow.Activities.AgentSettings() With {.MaxWaitTime = New System.TimeSpan(4, 0, 0), .MaxExecutionTime = New System.TimeSpan(0, 0, 0), .TagComparison = Microsoft.TeamFoundation.Build.Workflow.Activities.TagComparison.MatchExactly}]" this:Process.Verbosity="[Microsoft.TeamFoundation.Build.Workflow.BuildVerbosity.Normal]" this:Process.OutputFullHistory="True" this:Process.OutputBranchOrigin="True" this:Process.OnlyOutputChangedFiles="True" this:Process.StartChangeset="0"...... 

我通过替换 解决了这个问题TfsBuild.Process 为每个模板使用另一个名称(例如 TfsBuild.ProcessLabDefault )。请注意,您还应该更改 的所有实例。此:处理 因为两者链接在一起(例如 this:ProcessLabDefault )。
<Activity mc:Ignorable="sads sap sap2010" x:Class="TfsBuild.MyProcess" this:MyProcess.BuildNumberFormat="$(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.r)" this:MyProcess.AgentSettings="[New Microsoft.TeamFoundation.Build.Workflow.Activities.AgentSettings() With {.MaxWaitTime = New System.TimeSpan(4, 0, 0), .MaxExecutionTime = New System.TimeSpan(0, 0, 0), .TagComparison = Microsoft.TeamFoundation.Build.Workflow.Activities.TagComparison.MatchExactly}]" this:MyProcess.Verbosity="[Microsoft.TeamFoundation.Build.Workflow.BuildVerbosity.Normal]" this:MyProcess.OutputFullHistory="True" this:MyProcess.OutputBranchOrigin="True" this:MyProcess.OnlyOutputChangedFiles="True" this:MyProcess.StartChangeset="0"...... 

我没有找到通过使用界面查看代码和查找和替换作品来改变这一点的方法。希望能帮助到你。

关于tfs - 项目中多个构建模板(xaml 文件)的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14633759/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com