How To: Bypass Post-Build Steps in a Build Lab Environment

(Can you tell I'm going through my folder of interesting MSBuild questions today?)

Here's another good question that came across our internal discussion alias last week:

Is there a quick and easy way to bypass the PostBuild steps in a project file that was created with VS.NET 2005? I am trying to set up a master build project that will be compiling a large number of other projects, some that contain PostBuild steps that are not appropriate for our master build. Is there something I can define that will then cause the PostBuild steps to be skipped?

I actually didn't know the answer to this one off the top of my head, but since the entire build process is available for the world to see, it didn't take much to figure it out. I cracked open the Microsoft.Common.Targets file in Visual Studio and looked at how the PostBuildStep is set up. Here's an excerpt from the file:

<Target Name="PostBuildEvent" Condition="'$(PostBuildEvent)'!='' and [...]>

Notice how the condition is set up. In the build lab, you can simply pass /p:PostBuildEvent="" on the command line to disable all the post build events in the included projects.

[ Author: Neil Enns ]