I'm finishing setting up a TFS Build definition and having problems with getting MSBuild to run any code that I've put in the Custom.After.Microsoft.Common.Targets file. The file is definately in the right place, and is definately being parsed (breaking the syntax in the file causes build errors), but none of the code in it gets run. I've put the exact same code in the TFSBuild.proj file, and it works fine. All the correct targets get over-written etc. Any ideas what's causing this?
A:
This may be a stupid question but you placed that file in the right location on the build server right?
Sayed Ibrahim Hashimi
2009-06-24 20:15:01
Yeah, it's on the build server and is definately being parsed, as breaking the syntax by removing a > causes errors.
Barn
2009-06-24 20:19:10
A:
Remember evaluation priority; If an item or property is set then it won't be overwritten in a latter include except where you call CreateProperty or CreateItem tasks. I found that this stopped me from running conditional tasks.
Set verbosity to 'diag' to see what gets evaluated on the server build when including.
Preet Sangha
2009-06-24 20:32:14
My bad, i meant to put Custom.After.Microsoft.Common.Targets (which I've now corrected), so the evaluation order shouldn't be a problem.
Barn
2009-06-24 20:36:43
A:
OK, it actually did turn out to be the evaluation order, but not how we expected. The property group for DropBuildDependsOn was extended by us, but was then overridden later on by the TeamFoundation targets file. WE instead modified this file to import our project as well and it now all works.
Barn
2009-06-25 09:10:12
You should place your overrides after the Import statement for the TF targets file.
Sayed Ibrahim Hashimi
2009-06-30 16:41:51