TFS & Visual Studio ALM – by Neno Loje

(formerly Team System, VSTS)

Writing the Build Report with Associated Changesets and Work Items to a file as part of the build

May 19th, 2014 · 3 Comments · Team Foundation Build (TF Build), Tools and Utilities

The Goal

TFS has a nice Build Reporting, including a list of associated changesets and work items (if any). You might want to have this information saved to a file during a build.

Figure 7.6 Build Report

The Solution

When you use the new TfvcTemplate.12.xaml build process template, it’s easy to run addition scripts or tools as part of the build process.

There is a tool available (TfbNotes.exe) that generates a build report in .TXT and .XML format. It is free and can be downloaded here.

All you need is to check-in the file into version control and reference it in the build process, for example at “3. Test” » “2. Advanced” » “Post-test script path”.


Note: To run more than a single tool, use batch files or PowerShell scripts.

Here’s how the .TXT output looks like:


Note: TFS 2013 Update 2 (2013.2) is required. If you are not on Update 2, you can explicitly use the /collection (or just "/c") parameter to specify your TFS Collection URL.



Updated (May 21, 2014): Added a note that TFS 2013 Update 2 is required (+ workaround).


3 Comments so far ↓

  • Chris

    Many thanks for posting this solution! Ive tried to get TfbNotes.exe working but my builds all fail with the following error message:

    Exception Message: TF270015: ‘TfbNotes.exe’ returned an unexpected exit code. Expected ‘0’; actual ‘100’. See the build logs for more details. (type UnexpectedExitCodeException)
    Exception Stack Trace: at System.Activities.Statements.Throw.Execute(CodeActivityContext context)
    at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
    at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

    Any thoughts on this issue?

  • neno


    Please send the console output of the tool! You can find it on the Logs folder on the drop location, or you can access the full diagnostic logs when using Team Web Access as you can see here:

    Also, feel free to use the “Contact” feature of this blog, so I can actually reach you! :)


  • neno

    UPDATE: Chris’ issue is resolved. It turns out that the TF_BUILD_COLLECTIONURI environment variable was introduced in TFS 2013 Update 2 (2013.2).

    So to run this tool, you either need TFS 2013.2 – or alternatively you can specify the TFS Collection URL with the /collection (or just “/c”) parameter.


Leave a Comment