TF215097:初始化构建定义的构建时发生错误

时间:2016-05-11 12:28:27

标签: tfs build workflow tfsbuild

我在TFS中构建我的workkflow时收到如下所示的错误

TF215097: An error occurred while initializing a build for build definition  
Exception Message: Cannot create unknown type '{clr-namespace:Test.Activity;assembly=Test.Activity}GenerateAssemblyVersion'. (type  XamlObjectWriterException)
Exception Stack Trace:    at System.Xaml.XamlObjectWriter.WriteStartObject(XamlType xamlType)
 at System.Xaml.XamlServices.Transform(XamlReader xamlReader, XamlWriter   xamlWriter, Boolean closeWriter)
at System.Activities.XamlIntegration.FuncFactory`1.Evaluate()
 at System.Activities.DynamicActivity.OnInternalCacheMetadata(Boolean  createEmptyBindings)
 at System.Activities.Activity.InternalCacheMetadata(Boolean  createEmptyBindings, IList`1& validationErrors)
 at System.Activities.ActivityUtilities.ProcessActivity(ChildActivity  childActivity, ChildActivity& nextActivity, Stack`1& activitiesRemaining,    ActivityCallStack parentChain, IList`1& validationErrors,  ProcessActivityTreeOptions options, ProcessActivityCallback callback)
  at   System.Activities.ActivityUtilities.ProcessActivityTreeCore(ChildActivity  currentActivity, ActivityCallStack parentChain, ProcessActivityTreeOptions  options, ProcessActivityCallback callback, IList`1& validationErrors)
  at System.Activities.ActivityUtilities.CacheRootMetadata(Activity  activity, LocationReferenceEnvironment hostEnvironment,  ProcessActivityTreeOptions options, ProcessActivityCallback callback, IList`1& validationErrors)
  at  System.Activities.Validation.ActivityValidationServices.InternalActivityValidati onServices.InternalValidate()
  at   Microsoft.TeamFoundation.Build.Workflow.WorkflowHelpers.ValidateWorkflow(Activity activity, ValidationSettings validationSettings)
   at  Microsoft.TeamFoundation.Build.Hosting.BuildProcessCache.LoadFromXaml(String workflowXaml, TextExpressionImports textExpressionImports)
at    Microsoft.TeamFoundation.Build.Hosting.BuildControllerWorkflowManager.PrepareReq     uestForBuild(WorkflowManagerActivity activity, IBuildDetail build,  WorkflowRequest request, IDictionary`2 dataContext)
    at    Microsoft.TeamFoundation.Build.Hosting.BuildWorkflowManager.TryStartWorkflow(WorkflowRequest request, WorkflowManagerActivity activity, BuildWorkflowInstance& workflowInstance, Exception& error, Boolean& syncLockTaken)

我已经尝试了http://blog.ehn.nu/2011/12/tfs-2010-build-troubleshooting-the-tf215097-error/中指定的所有内容。但我仍然在犯同样的错误

此外,当我在Customtask中使用以下代码时,我能够发现问题正在发生

public sealed class Myclass: BaseCodeActivity
{
    protected override void InternalExecute()
    {
    }
  }

如果我使用下面的代码能够成功构建。

public sealed class Myclass: CodeActivity
{
    protected override void Execute(CodeActivityContext context)
    {
    }
}

我能够在本地计算机上成功构建上述代码。

BuildCodeActivity类派生自命名空间TfsBuildExtensions.Activities。所以我将所有依赖于此类的dll(包括TfsBuildExtensions.Activities)添加到我的dll所在的根文件夹中

我无法找到BuildCodeActivity类抛出此错误的原因

1 个答案:

答案 0 :(得分:0)

  1. 请提供有关您的环境和所做工作的更多信息。
  2. 创建新的构建定义和队列构建,以查看是否可以重现此问题。
  3. 创建一个轻型项目和队列构建,以查看是否会重现此问题。
  4. 创建一个新的构建代理,以确定您是否会重现此问题。