Visual Studio Team Build

One question I was asked today after my SharePoint presentation was related to Team Build.  The question was how do I run a specific task (i.e. build documentation) in my build?

You need to modify the TFSBuild.proj file to add your custom task
  • In Source Control Explorer in your project select TeamBuildTypes, right click it and Check Out for Edit
  • Double click the TFSBuild.proj file and it will open in Visual Studio

You basically have to use the MSBuild Exec task to run your command, so it might look something like:

<Target Name="AfterCompile">
    <Exec Command="&quot;C:\dir\generateDoc&quot; &quot;$(SolutionRoot)\MySource&quot;"/>
    <Copy SourceFiles="$(SolutionRoot)\MySource\MyDoc.doc" DestinationFolder="$(OutDir)" />


  • Save your changes, close the file and Check in your pending changes and trigger a build.

I also mentioned the tool MSBuild Sidekick by Attrice to edit your TFSBuild.proj file.  Here is a screenshot: 



About Wes MacDonald

Wes MacDonald is a DevOps Consultant for LIKE 10 INC., a DevOps consulting firm providing premium support, guidance and services for Azure, Microsoft 365 and Azure DevOps.

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: