开发者

Target not being executed when imported to the main *.proj file

开发者 https://www.devze.com 2023-01-01 08:03 出处:网络
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 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 tar开发者_开发知识库get defined in my main *.proj file, it is executed. Can someone explain why the target isn't executed when imported from a file?

Thanks,


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消