What is the difference between DependsOnTargets and AfterTargets?
I can not distinguish these two.
What is the difference between DependsOnTargets and AfterTargets ? I can not distinguish these
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
DependsOnTargets
Defines the targets that must be executed before the target can be executed.
BeforeTargets and AfterTargets (Only available in MSBuild 4)
Indicates that the target should run before or after the specified target or targets.
If you have multiples targets that should run before or after the same specified target, they will be executed in declaration order :
BeforeTargetsandAfterTargetscould be use to extend existing build process.For example, with this attributes you can easily execute a target before CoreCompile (defines in Microsoft.CSharp.targets). Without that you’ll have to override the property
CoreCompileDependsOn.Without
AfterTargetsyou have no way to easily execute a target after another one if no extension point is defined (CallTargetat the end of the target with a property that you can override)DependsOnTargets, BeforeTargets and AfterTargets execution order?
When
DependsOnTargets,BeforeTargetsandAfterTargetsare used on the same target, the order of execution is :DependsOnTargetsBeforeTargetsAfterTargets