0
votes

I use the TFS 2008 build facilities. I have a large MSBuild project (TFSBuild.proj) and I wanted to split it into a few files because it is becoming hard to maintain.

I found a strange behavior; when I extracted one of the targets (BeforeInitializeWorkspace) to a separate file and then imported it into the main *.proj file, it was not executed. Although, in my MSBuild log, there was information that the target has been imported and overridden, but hasn't been executed. If I have the same target defined in my main *.proj file, it is executed. Can someone explain why the target isn't executed when imported from a file?

Thanks,

1

1 Answers

0
votes

Me being stupid ;)

I had the order of <Import> wrong. The first file to import was my overridden target, then the Microsoft.TeamFoundation.Build.targets was imported and overrode my target.

Anyway, changing the order helped. So now, the Microsoft.TeamFoundation.Build.targets is the first target to import and then all my other targets.