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)" />
</Target>
</Project>

 

  • 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: 

image

 

About wesmacdonald

Wes MacDonald is a Visual Studio ALM MVP, PSD, MCT and a Principal Consultant for LIKE 10 INC., a SharePoint Server, Visual Studio and Team Foundation Server Consulting Firm providing premium support and guidance services.

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:

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: