I have just created a custom workflow activity and configured my Build Controller to pick up the compiled binary from my source control location. However, I could not get the assembly to resolve correctly by simply placing it in source control.
I receive this error message:
The build process failed validation. Details: Validation Error: The private implementation of activity '1: DynamicActivity' has the following validation error: TF28001: Activity 'GetBuildNumber' can not be used in the context of an AgentScope.
This is the code that I have used in my custom workflow activity:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Activities;
using Microsoft.TeamFoundation.Build.Client;
namespace BuildTasks.Activities
{
[BuildActivity(HostEnvironmentOption.Controller)]
public sealed class GetBuildNumber : CodeActivity<string>
{
[RequiredArgument]
public InArgument<IBuildDetail> BuildDetail { get; set; }
// If your activity returns a value, derive from CodeActivity<TResult>
// and return the value from the Execute method.
protected override string Execute(CodeActivityContext context)
{
IBuildDetail buildDetail = context.GetValue(this.BuildDetail);
//return the build number
return buildDetail.BuildNumber;
}
}
}
Please advise as to what I may be doing incorrectly which is resulting in this error message.
Thanks.