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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With