如何添加自定义TFS构建的"摘要信息"消息?

Nam*_* VU 4 c# workflow-activity visual-studio-2012 tfs2012 build-process-template

我正在为TFS构建流程工作流程编写自定义活动,例如此处的指南.

在我的C#CodeActivity .Execute()方法中,我想将我的文本输出到TFS构建中summary information作为下面的快照.

我怎样才能做到这一点?

在此输入图像描述

Hoa*_*yen 6

您应该使用该CustomSummaryInformation对象来显示摘要消息.这是代码.希望能帮助到你.

 protected override void Execute(CodeActivityContext context)
 {
    var summaryReport = new CustomSummaryInformation()
    {
    Message = "Your message",
    SectionPriority = 0,
    SectionHeader = "Header Name",
    SectionName = "Section Name",
    };
    context.Track(summaryReport);
}
Run Code Online (Sandbox Code Playgroud)