如何在自定义 BuildActivity 中使用 BuildMessage?
如何在自定义 BuildActivity 中添加 BuildMessage?
[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"
};
}
}
对于WorklowActivity
有一个特殊的 WorkflowInvoker...
非常感谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可以使用 CodeActivityContext 来登录 CodeActivity。
示例:
TrackBuildMessage
是一个扩展方法,可以在命名空间中找到:Microsoft.TeamFoundation.Build.Workflow.Activities
Logging in a CodeActivity can be done using the CodeActivityContext.
Example:
TrackBuildMessage
is an Extension method which can be found in namespace:Microsoft.TeamFoundation.Build.Workflow.Activities