12

Consider this simple msbuild script (xaml):

<Activity xmlns=[....]>
  <Sequence>
    <mtbwa:WriteBuildMessage Message="Test message"/>
    <mtbwa:WriteBuildWarning Message="Test warning"/>
  </Sequence>
</Activity>

I have a tfs build definition based on this script. When I queue a new build in tfs, the warning is displayed under "view log", the message is not displayed.

What do you think of that?

Askolein
  • 3,250
  • 3
  • 28
  • 40
Gerard
  • 13,023
  • 14
  • 72
  • 125

1 Answers1

18

This is approx. a minimal workflow xaml file that works:

<Activity xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities"
          xmlns:mtbwa="clr-namespace:Microsoft.TeamFoundation.Build.Workflow.Activities;assembly=Microsoft.TeamFoundation.Build.Workflow">
  <Sequence>
    <mtbwa:WriteBuildMessage Importance="[Microsoft.TeamFoundation.Build.Client.BuildMessageImportance.High]"
                             Message="Test WriteBuildMessage Importance High"/>
  </Sequence>
</Activity>

Default tfsbuild verbosity for logging in view log is normal but this will not display BuildMessageImportance.Normal, only High.

Another gotcha is that you have to click the button Refresh for the build process template in it's build definition under item Process.

This is a minimal workflow example that works including the BuildVerbosity property.

<Activity xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities"
          xmlns:mtbw="clr-namespace:Microsoft.TeamFoundation.Build.Workflow;assembly=Microsoft.TeamFoundation.Build.Workflow"
          xmlns:mtbwa="clr-namespace:Microsoft.TeamFoundation.Build.Workflow.Activities;assembly=Microsoft.TeamFoundation.Build.Workflow"
          xmlns:this="clr-namespace:TfsBuild"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          x:Class="TfsBuild.Process"
          this:Process.Verbosity="[Microsoft.TeamFoundation.Build.Workflow.BuildVerbosity.Diagnostic]">
  <x:Members>
    <x:Property Name="Verbosity"
                Type="InArgument(mtbw:BuildVerbosity)" />
  </x:Members>
  <Sequence>
    <mtbwa:WriteBuildMessage Importance="[Microsoft.TeamFoundation.Build.Client.BuildMessageImportance.Low]"
                             Message="Test WriteBuildMessage Importance Low"/>
  </Sequence>
</Activity>
Gerard
  • 13,023
  • 14
  • 72
  • 125
  • I did have to set my verbiosity to high on my messages, but I didn't have to refresh the build template. – McKay Sep 23 '10 at 20:51
  • A little follow up... I DID have to refresh the process template for the logging message to appear. Thanks Gerard. –  Jan 28 '11 at 20:58
  • A little further follow up... Neither setting it to high or refreshing worked for me in TFS /VS 2012. I had to set the logging verbosity to Normal in the Queue Build parameters tab for it to show at all. – 4imble Jan 17 '13 at 14:21