TFS 2010 Build Automation and post-build event

marc_s picture marc_s · Feb 21, 2011 · Viewed 12.9k times · Source

In the project I've inherited, the original developer used a number of post-build events in his Visual Studio projects to copy around DLL's and stuff when building inside VS.

This is causing some grief now that I'm trying to move these things to the TFS 2010 Build system.

I was hoping to be able to create a new "Continuous" project configuration, and exclude those post-build events from Visual Studio in that configuration - but it seems those calls aren't configurable based on your project configuration....

Any ideas? Is there something I could check for to know I'm running under TFS Build and then just skip those CMD files? Any ideas would be most welcome!

Answer

Giulio Vian picture Giulio Vian · May 26, 2011

My approach is to guard the pre- or post-build code with this

IF "$(BuildingInsideVisualStudio)"=="true" ( …your code here… )

That variable is automatically defined by Visual Studio and you do not need to change the build definition.