4

I'm writing a customized activity for TFS build process workflow, e.g. guideline here.

In my C# CodeActivity .Execute() method, I want to output my text to the TFS build 's summary information as the snapshot below.

How can I do that?

enter image description here

Nam G VU
  • 33,193
  • 69
  • 233
  • 372

1 Answers1

6

You should to use the CustomSummaryInformation object to display the summary message. Here is the code. Hope it helps.

 protected override void Execute(CodeActivityContext context)
 {
    var summaryReport = new CustomSummaryInformation()
    {
    Message = "Your message",
    SectionPriority = 0,
    SectionHeader = "Header Name",
    SectionName = "Section Name",
    };
    context.Track(summaryReport);
}
Nam G VU
  • 33,193
  • 69
  • 233
  • 372
Hoang Nguyen
  • 1,348
  • 1
  • 10
  • 17
  • In my case (.NET 4.6.1) - I had to use `System.Activities.Tracking.CustomTrackingRecord` instead of `CustomSummaryInformation` – itsho Mar 27 '19 at 14:37