tags:

views:

17

answers:

1

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?

A: 

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.

Jim Lamb
Actually I ended up with something like your suggestion. I read somewhere that IsDesktopBuild could be used, modified my projects to use it but it didn't work. I gave up and set it manually in MSBuild Argument.I am going to check if BuildingInsideVisualStudio works.Thanks.
Maxim Alexeyev