How Can I add BuildMessage(s) in custom BuildActivity?
[BuildActivity(HostEnvironmentOption.Agent)]
public sealed class InvokeDotNetReactor : CodeActivity
{
[RequiredArgument]
public InArgument<string> SourcesDirectory { get; set; }
protected override void Execute(CodeActivityContext context)
{
...
BuildMessage bm = new BuildMessage()
{
Importance = BuildMessageImportance.High,
Message = "Hello From Custom TFS Build Activity"
};
}
}
}
For WorklowActivity there is a special WorkflowInvoker...
Thank's a lot.
Logging in a CodeActivity can be done using the CodeActivityContext.
Example:
protected override void Execute(CodeActivityContext context)
{
context.TrackBuildMessage("Hello from Custom TFS Build Activity", BuildMessageImportance.High);
}
TrackBuildMessage
is an Extension method which can be found in namespace: Microsoft.TeamFoundation.Build.Workflow.Activities
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With