I've been meaning to write a blog post on these issues, but haven't gotten around to it yet...
Team Build overrides the OutDir property for each solution it builds. It does this because it needs the various binaries to be in a common location so that it can copy them all to the drop location, point any unit tests that need to get run at them, etc. Typically your binaries will first be compiled into an intermediate directory (this is the "obj" directory) and then copied into their final output directory (within VS this is the "bin" directory, in a Team Build this is the $(BinariesRoot) directory).
So - one possibility for you is to copy the files from the intermediate directory instead of the final output directory. This should exist in both a VS build and a Team Build. Another possibility would be to use a path relative to the output directory - the Exec task MSBuild uses to execute your post build event looks like the following (this is in Microsoft.Common.targets):
< Exec WorkingDirectory="$(OutDir)" Command="$(PostBuildEvent)" />
Since the working directory is already set to $(OutDir) - which will be bin\debug in the one case, and $(BinariesRoot)\debug in the other - you should be able to just do everything relative to it.
-Aaron
|