How to force to Fail a Job?

Thank you, @danielrinf! To fail a job, just throw an exception from a job method. After that, an automatic retry attempt is made by default, but you can disable it by applying an explicit attribute:

[AutomaticRetry(Attempts = 0)]
public void SomeJob()
{
    throw new InvalidOperationException("This job will never succeed.");
}
1 Like