January 28, 2011

TFSbuild custom parameters and Testing

To test your Team Build Project locally with TFSBuild use the Visual Studio 2010 command prompt.
here's a sample
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>TFSBuild start /collectio
n:http://MYSERVER:8080 /builddefinition:"MYTFS/TestBuild" /droplocation:"\\

However firstly I recommend testing the syntax of your project with MsBuild
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>msbuild C:\SOMEDIR\TeamBui

In order to tell msbuild to run a particular target within use something like
C:\MsBuildSamples>msbuild TfsBuild.proj /t:DesktopRebuild
this will run the Target "DesktopRebuild".

Passing Parameters/Arguments

To use parameters passed in through TFSbuild it's simple, just pass in your argument with the /property switch on the command line or do it through the Visual Studio Team Build UI.
this can first be tested with MSBuild
C:\TeamBuildTypes\MsBuildSamples>msbuild TfsBuild.proj /t:DesktopRebuild

inside in your TfsBuild.proj tjos argument can used anywhere with the syntax $(MyArgument)

And further test with TFSBuild from the command line
C:\Topoix\TeamBuildTypes\MsBuildSamples>TFSBuild start /collection:http://offaly
:8080 /builddefinition:"Topoix-scrum/TestBuild" /droplocation:"\\dunnacarraige\b
uildDrops" /msbuildarguments:"/p:MyArgument=2"

These same msbuildarguments can be passed in through the Visual Studio Queue Build dialog in the "MSBuild command line arguments" panel with

January 27, 2011

Build with .NET 4.0 in Team Foundation Server

In order to force your Team Build to use the .NET assemblies and tools you'll need to make the following change.

Change the value in the

C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\tfsbuildservice.exe.config


add key="MSBuildPath" value=""


add key="MSBuildPath" value="C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319"

TFS service must be restarted afterwards "Visual Studio Team Foundation Build"