【问题标题】:How to add a customized TFS build 's `summary information` message?如何添加自定义 TFS 构建的“摘要信息”消息?
【发布时间】:2014-01-14 07:56:35
【问题描述】:

我正在为 TFS 构建流程工作流编写自定义活动,例如指导方针here

在我的 C# CodeActivity .Execute() 方法中,我想将我的文本输出到 TFS build 的summary information,如下图所示。

我该怎么做?

【问题讨论】:

    标签: c# visual-studio-2012 workflow-activity build-process-template


    【解决方案1】:

    您应该使用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);
    }
    

    【讨论】:

    • 在我的情况下 (.NET 4.6.1) - 我必须使用 System.Activities.Tracking.CustomTrackingRecord 而不是 CustomSummaryInformation
    猜你喜欢
    • 1970-01-01
    • 2019-09-16
    • 1970-01-01
    • 2012-03-04
    • 2020-01-05
    • 2019-12-25
    • 1970-01-01
    • 1970-01-01
    • 2017-06-11
    相关资源
    最近更新 更多