How can I say that the build was successful in the AfterBuild target program in msbuild?

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

I read somewhere that PostBuildEvent runs after a successful build, but AfterBuild starts independently. It's true?

+5
source share
1 answer

AfterBuild target will not be called if the assembly is not successful.

In $(MSBuildToolsPath)\Microsoft.Common.targetsit is defined as follows:

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

If the assembly fails ( CoreBuildtarget), AfterBuildit will not be called.

+5
source

All Articles