Search code examples
msbuildmsbuild-taskmsbuild-4.0

Ensure an msbuild task is run at the end of the build


I am looking at improving one of our build systems, but it's a bit of an unorganised mess. I want to add a task which is run at the end of a Release build only and after all other tasks we have such as FxCop/StyleCop/signing processes.

Is there an easy way of specifying a task that you want at the absolute end of a build? I've currently got the task running after the build (using AfterBuild Target) but this doesn't make sense for what the task is doing.

Cheers, Jamie


Solution

  • The Targets tag takes "DependsOnTargets" attribute and "Condition" attribute. You can effectively use these attributes in AfterBuild.