I have an AfterBuild task which signs the dll using signtool.exe via the NuGet package MSBuild.ExtensionPack
<MSBuild.ExtensionPack.Framework.CommandLine Command=""C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin\signtool.exe" sign "/n" "MY CERTIFICATE" "/t" "http://timestamp.comodoca.com/authenticode" "$(TargetPath)."" Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
Due to some differences between build environments (some remote build agents have different versions of Visual Studio and therefore the Windows SDK) this task fails when an agent has SDK version 8.0 installed.
Is it possible to trigger a different task if and only if a task fails?
i.e. if the above task fails, run an alternative task which has a different path to signtool.exe