Maxim Alexeyev
Maxim Alexeyev

Reputation: 1031

Using _TEAM_BUILD_ with TFS 2010

We moved from TFS 2008 to TFS 2010.

With TFS 2008 I used _TEAM_BUILD_ in project file const to turn PostBuild event off when building by build server.

Now, when I create build definition with new format, without using tfsbuild.proj, but using Default template, it doesn't seem to work. I have PostBuildEvent running even though I am using same approach.

Any ideas how to achive same functionality, having PostBuildEvent running from Visual Studio and to be ignored on build machine?

Upvotes: 1

Views: 396

Answers (1)

Jim Lamb
Jim Lamb

Reputation: 25775

Check for BuildingInsideVisualStudio. As you'd suspect, it's only defined when building inside Visual Studio. Alternatively, you could add "/p:_TEAM_BUILD_=1" to the MSBuild Arguments build process parameter of your build definition.

Upvotes: 2

Related Questions