Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do i tell the build was successful in AfterBuild target in msbuild?

Tags:

msbuild

Basically, I would like to perform some tasks in AfterBuild target but only when the build is successful.

I read somewhere that PostBuildEvent is run after a successful build but AfterBuild is run regardless. Is this true?

like image 861
Jiho Han Avatar asked Aug 19 '11 16:08

Jiho Han


1 Answers

AfterBuild target won't be called if the build is not successful.

It is defined like this in $(MSBuildToolsPath)\Microsoft.Common.targets:

<PropertyGroup>
  <BuildDependsOn>
    BeforeBuild;
    CoreBuild;
    AfterBuild
  </BuildDependsOn>
</PropertyGroup>

If the build fails (CoreBuild target), AfterBuild won't be called.

like image 166
Julien Hoarau Avatar answered Sep 28 '22 05:09

Julien Hoarau