How to run msbuild projects with TeamCity-specific tasks OUTSIDE TeamCity?

Hi,

[I couldn't find the solution to this that must be a common problem, sorry if it's been posted before]

I run msbuild projects from within TeamCity with great success. However, I sometimes want to modify the msbuild proj files on my developer machine (not on the build server). The problem is then, that the msbuild project files are sprinkled with TeamCity-specific stuff that doesn't work when run directly with msbuild.exe. Examples:

<UsingTask TaskName="NUnit" AssemblyFile="$(teamcity_dotnet_nunitlauncher_msbuild_task)" />
<TeamCitySetBuildNumber BuildNumber="$(Version)" />
<TeamCityProgressMessage Text="Building $(Configuration)" />

The solution is to temporary comment out those lines, but is there a good solution to this problem?

Thanks a lot.

//Sire

2 comments
Comment actions Permalink

What I do is have it detect something that is specific to being built on a TeamCity agent and put it inside the 'Condition'.  Like this:

<TeamCityProgressMessage
               Condition="'$(TEAMCITY_BUILD_PROPERTIES_FILE)' != '' "
               Text="Message to the TC interface" />

Hope this helps.

Dave

0
Comment actions Permalink

Thanks a lot, that did it!

JetBrains developers, please include this in the manual!

0

Please sign in to leave a comment.