在TFS 2010上,当我启动包含自定义活动的构建定义时,我遇到了这个错误:
TF215097: An error occurred while initializing a build for build definition \BCA3\BuildProcessSourcet8: Cannot create unknown type '{clr-namespace:BuildProcessSourcet8.Activities;assembly=Sourcet8}CopyActivity'.
XAML文件的一部分:
<Activity mc:Ignorable="sads sap sap2010" x:Class="TfsBuild.Process" this:Process.AutomatedTests="[{ New Microsoft.TeamFoundation.Build.Common.BuildParameter(" { ""AssemblyFileSpec"": ""**\\*test*.dll;**\\*test*.appx"", ""RunSettingsFileName"": null, ""TestCaseFilter"": """", ""RunSettingsForTestRun"": { ""ServerRunSettingsFile"": """", ""TypeRunSettings"": ""Default"", ""HasRunSettingsFile"": false }, ""HasRunSettingsFile"": false, ""HasTestCaseFilter"": false, ""ExecutionPlatform"": ""X86"", ""FailBuildOnFailure"": false, ""RunName"": """" } ") }]" this:Process.AdvancedTestSettings="[New Microsoft.TeamFoundation.Build.Common.BuildParameter(" { ""AnalyzeTestImpact"": false, ""DisableTests"": false, ""PreActionScriptPath"": """", ""PreActionScriptArguments"": """", ""PostActionScriptPath"": """", ""PostActionScriptArguments"": """" } ")]" this:Process.BuildNumberFormat="["$(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.r)"]" this:Process.CleanWorkspace="[True]" this:Process.CreateLabel="[True]" this:Process.AdvancedBuildSettings="[New Microsoft.TeamFoundation.Build.Common.BuildParameter(" { ""MSBuildArguments"": """", ""MSBuildPlatform"": ""Auto"", ""PreActionScriptPath"": """", ""PreActionScriptArguments"": """", ""PostActionScriptPath"": """", ""PostActionScriptArguments"": """", ""RunCodeAnalysis"": ""AsConfigured"" } ")]" this:Process.AgentSettings="[New Microsoft.TeamFoundation.Build.Common.BuildParameter(" { ""MaxExecutionTime"": ""00:00:00"", ""MaxWaitTime"": ""04:00:00"", ""Name"": ""*"", ""Tags"": [], ""TagComparison"": ""MatchExactly"" } ")]" this:Process.CleanBuild="[True]" this:Process.OutputLocation="["SingleFolder"]" this:Process.CreateWorkItem="[True]" this:Process.UpdateAssociatedWorkItems="[True]" this:Process.SupportedReasons="All" this:Process.BuildProcessVersion="12.0"
xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities"
xmlns:local="clr-namespace:BuildProcessSourcet8;assembly=Sourcet8"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mtba="clr-namespace:Microsoft.TeamFoundation.Build.Activities;assembly=Microsoft.TeamFoundation.Build.Activities"
xmlns:mtbac="clr-namespace:Microsoft.TeamFoundation.Build.Activities.Core;assembly=Microsoft.TeamFoundation.Build.Activities"
xmlns:mtbat="clr-namespace:Microsoft.TeamFoundation.Build.Activities.TeamFoundation;assembly=Microsoft.TeamFoundation.Build.Activities"
xmlns:mtbc="clr-namespace:Microsoft.TeamFoundation.Build.Common;assembly=Microsoft.TeamFoundation.Build.Common"
xmlns:mtbc1="clr-namespace:Microsoft.TeamFoundation.Build.Client;assembly=Microsoft.TeamFoundation.Build.Client"
xmlns:mtbw="clr-namespace:Microsoft.TeamFoundation.Build.Workflow;assembly=Microsoft.TeamFoundation.Build.Workflow"
xmlns:mtbwa="clr-namespace:Microsoft.TeamFoundation.Build.Workflow.Activities;assembly=Microsoft.TeamFoundation.Build.Workflow"
xmlns:mtbwt="clr-namespace:Microsoft.TeamFoundation.Build.Workflow.Tracking;assembly=Microsoft.TeamFoundation.Build.Workflow"
xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities"
xmlns:s="clr-namespace:System;assembly=mscorlib"
xmlns:sads="http://schemas.microsoft.com/netfx/2010/xaml/activities/debugger"
xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation"
xmlns:sap2010="http://schemas.microsoft.com/netfx/2010/xaml/activities/presentation"
xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib"
xmlns:sco="clr-namespace:System.Collections.ObjectModel;assembly=mscorlib"
xmlns:this="clr-namespace:TfsBuild"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
答案 0 :(得分:1)
解决方案似乎将自定义活动DLL放在GAC中。
答案 1 :(得分:0)
我通过在构建计算机中安装相同版本的VisualStudio和TFS客户端解决了该问题。例如,安装VS 2013和TFS 2013,并确保您也使用VS 2013构建自定义dll。