我在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类抛出此错误的原因
答案 0 :(得分:0)