Hangfire 1.8.25

Hangfire

Official Site Latest version Downloads License LGPLv3 Coverity Scan

Build Status

  main dev
AppVeyor Windows Build Status Windows Build Status

Overview

Incredibly easy way to perform fire-and-forget, delayed and recurring jobs in .NET applications. CPU and I/O intensive, long-running and short-running jobs are supported. No Windows Service / Task Scheduler required. Backed by Redis, SQL Server, SQL Azure and MSMQ.

Hangfire provides a unified programming model to handle background tasks in a reliable way and run them on shared hosting, dedicated hosting or in cloud. You can start with a simple setup and grow computational power for background jobs with time for these scenarios:

  • mass notifications/newsletters
  • batch import from xml, csv or json
  • creation of archives
  • firing off web hooks
  • deleting users
  • building different graphs
  • image/video processing
  • purging temporary files
  • recurring automated reports
  • database maintenance
  • …and so on

Hangfire is a .NET alternative to Resque, Sidekiq, delayed_job, Celery.

Hangfire Dashboard

Installation

Hangfire is available as a NuGet package. You can install it using the NuGet Package Console window:

PM> Install-Package Hangfire

After installation, update your existing OWIN Startup file with the following lines of code. If you do not have this class in your project or don't know what is it, please read the Quick start guide to learn about how to install Hangfire.

public void Configuration(IAppBuilder app)
{
    GlobalConfiguration.Configuration.UseSqlServerStorage("<connection string or its name>");
    
    app.UseHangfireServer();
    app.UseHangfireDashboard();
}

Usage

This is an incomplete list of features; to see all of them, check the official site and the documentation.

Fire-and-forget tasks

Dedicated worker pool threads execute queued background jobs as soon as possible, shortening your request's processing time.

BackgroundJob.Enqueue(() => Console.WriteLine("Simple!"));

Delayed tasks

Scheduled background jobs are executed only after a given amount of time.

BackgroundJob.Schedule(() => Console.WriteLine("Reliable!"), TimeSpan.FromDays(7));

Recurring tasks

Recurring jobs have never been simpler; just call the following method to perform any kind of recurring task using the CRON expressions.

RecurringJob.AddOrUpdate(() => Console.WriteLine("Transparent!"), Cron.Daily);

Continuations

Continuations allow you to define complex workflows by chaining multiple background jobs together.

var id = BackgroundJob.Enqueue(() => Console.WriteLine("Hello, "));
BackgroundJob.ContinueWith(id, () => Console.WriteLine("world!"));

Process background tasks inside a web application…

You can process background tasks in any OWIN-compatible application framework, including ASP.NET MVC, ASP.NET Web API, FubuMvc, Nancy, etc. Forget about AppDomain unloads, Web Garden & Web Farm issues – Hangfire is reliable for web applications from scratch, even on shared hosting.

app.UseHangfireServer();

… or anywhere else

In console applications, Windows Service, Azure Worker Role, etc.

using (new BackgroundJobServer())
{
    Console.WriteLine("Hangfire Server started. Press ENTER to exit...");
    Console.ReadLine();
}

Questions? Problems?

Open-source projects develop more smoothly when discussions are public.

If you have any questions, problems related to Hangfire usage or if you want to discuss new features, please visit the discussion forum. You can sign in there using your existing Google or GitHub account, so it's very simple to start using it.

If you've discovered a bug, please report it to the Hangfire GitHub Issues. Detailed reports with stack traces, actual and expected behaviours are welcome.

Please see the Extensions page on the official site.

Building the sources

Prerequisites:

  • Razor Generator: Required if you intend to edit the cshtml files.
  • Install the MSMQ service (Microsoft Message Queue Server), if not already installed.

Then, create an environment variable with Variable name Hangfire_SqlServer_ConnectionStringTemplate and put your connection string in the Variable value field. Example:

  • Variable name: Hangfire_SqlServer_ConnectionStringTemplate
  • Variable value: Data Source=.\sqlexpress;Initial Catalog=Hangfire.SqlServer.Tests;Integrated Security=True;

To build a solution and get assembly files, just run the following command. All build artifacts, including *.pdb files, will be placed into the build folder. Before proposing a pull request, please use this command to ensure everything is ok. Btw, you can execute this command from the Package Manager Console window.

build

To build NuGet packages as well as an archive file, use the pack command as shown below. You can find the result files in the build folder.

build pack

To see the full list of available commands, pass the -docs switch:

build -docs

Hangfire uses psake build automation tool. All psake tasks and functions defined in psake-build.ps1 (for this project) and psake-common.ps1 (for other Hangfire projects) files. Thanks to the psake project, they are very simple to use and modify!

Razor templates are compiled upon save with the Razor Generator Visual Studio extension. You will need this installed if you want to modify the Dashboard UI.

Reporting security issues

In order to give the community time to respond and upgrade we strongly urge you report all security issues privately. Please email us at security@hangfire.io with details and we will respond ASAP. Security issues always take precedence over bug fixes and feature work. We can and do mark releases as "urgent" if they contain serious security fixes.

License

Copyright © 2013-2026 Hangfire OÜ.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see https://www.gnu.org/licenses/.

By submitting a Pull Request, you disavow any rights or claims to any changes submitted to the Hangfire project and assign the copyright of those changes to Hangfire OÜ.

If you cannot or do not want to reassign those rights (your employment contract for your employer may not allow this), you should not submit a PR. Open an issue and someone else can do the work.

This is a legal way of saying "If you submit a PR to us, that code becomes ours". 99.9% of the time that's what you intend anyways; we hope it doesn't scare you away from contributing.

No packages depend on Hangfire.

Release notes are available in our blog https://www.hangfire.io/blog/ Please see https://docs.hangfire.io/en/latest/upgrade-guides/upgrading-to-hangfire-1.8.html to learn how to upgrade.

1.8.25

Hangfire.Core

• Fixed – Add missing Persian translations for Dashboard UI (by @mohammad-goroohi). • Fixed – Small typo in Swedish translation (by @AntonHoog). • Fixed – Grammar and spelling in some user-facing messages (by @net0well). • Fixed – Complete "pt-BR" translation (@by net0well). • Fixed – Update Russian translation for Dashboard UI (by @akortunov). • Project – Add unit tests for DisableConcurrentExecutionAttribute (by @net0well). • Project – Use "mailto" scheme for security email in SECURITY.md (by @FirmaSpring).

Hangfire.SqlServer

• Added – SqlServerStorageOptions.DisableFetchSemaphores option to remove synchronization between workers.

1.8.24

Hangfire.Core

• Added – Russian translation for Dashboard UI (by @akortunov). • Changed – Slow log can now detect blocked extension filter executions.

1.8.23

Hangfire.Core

• Changed – Use stable sorting algorithm for background job filters again (by @jirikanda). • Fixed – Add missing keys for Swedish translation (by @karl-sjogren). • Fixed – Custom AutomaticRetryAttribute is ignored under certain conditions (by @jirikanda). • Project – Use TypeNameAssemblyFormatHandling in tests with .NET 6 (by @viktor-vintertass).

Hangfire.AspNetCore

• Fixed – InvalidOperationException: The request reached the end of the pipeline without executing the endpoint.

1.8.22

Hangfire.Core

• Added – IGlobalConfiguration.UseNoOpLogProvider method to disable logging. • Changed – Un-deprecate interval methods in the Cron class, add remarks in docs instead. • Changed – Bump internalized version of Cronos to 0.11.1. • Changed – Bump internalized version of Microsoft.Owin to 4.2.3. • Fixed – Serialization of arrays of nested types SimpleAssemblyTypeSerializer. • Fixed – Remove wrong escaping characters in Portuguese translations on the "Servers" page. • Fixed – Properly remove registered IBackgroundProcessingServer instances on OWIN app shutdown. • Fixed – AspNetShutdownDetector for early ASP.NET shutdown detection is not working (regression from 1.7.30). • Project – Replace the netcoreapp3.1 target with the net8.0 one in tests.

Hangfire.SqlServer

• Fixed – InvalidCastException when creating a background job with Schema 5 (regression from 1.8.15). • Project – Replace the netcoreapp3.1 target with the net8.0 one in tests.

Hangfire.AspNetCore

• Added – MapHangfireDashboardWithNoAuthorizationFilters method, which does not include local-only filters. • Changed – Set 404 status code when MapHangfireDashboard is used and no dispatcher is found. • Fixed – InvalidOperationException upon receiving a request for 'hangfire/bootstrap.min.css.map'.

1.8.21

Hangfire.Core

• Added – FailedState.IncludeFileInfo to optionally show/hide line numbers in exceptions in Failed state. • Changed – Include line numbers for exceptions by default when available. • Fixed – Portuguese (Brazil) translations in Strings.pt-BR.resx (by @pedro-cons). • Fixed – Static BackgroundJob class always acquires the most current JobStorage.Current instance. • Fixed – Static RecurringJob class always acquires the most current JobStorage.Current instance.

Hangfire.SqlServer

• Added – SqlServerStorageOptions.DisableTransactionScope option for .NET Framework targets. • Project – Port Monitoring API tests from the Hangfire.InMemory storage for better coverage. • Project – Run tests for different targets in parallel with different databases.

1.8.20

Hangfire.Core

• Fixed – Glyphicons from Bootstrap are not displaying after upgrading to version 1.8.19.

.NET Framework 4.5.1

.NET Standard 1.3

.NET Standard 2.0

Version Downloads Last updated
1.8.25 1 08/31/2026
1.8.24 17 07/16/2026
1.8.23 37 02/06/2026
1.8.22 36 12/10/2025
1.8.21 35 12/13/2025
1.8.20 24 12/17/2025
1.8.19 20 12/31/2025
1.8.18 32 12/10/2025
1.8.17 28 12/16/2025
1.8.16 34 12/20/2025
1.8.15 28 12/14/2025
1.8.14 34 12/13/2025
1.8.12 35 12/20/2025
1.8.11 32 12/14/2025
1.8.10 23 12/18/2025
1.8.9 36 12/20/2025
1.8.7 22 12/20/2025
1.8.6 25 12/17/2025
1.8.5 25 12/17/2025
1.8.4 26 12/20/2025
1.8.3 25 12/13/2025
1.8.2 30 12/20/2025
1.8.1 25 12/15/2025
1.8.0 24 12/15/2025
1.8.0-rc4 25 12/14/2025
1.8.0-rc3 28 12/15/2025
1.8.0-rc2 37 12/10/2025
1.8.0-rc1 24 12/31/2025
1.8.0-beta4 27 12/12/2025
1.8.0-beta3 34 12/13/2025
1.8.0-beta2 31 12/15/2025
1.8.0-beta1 24 12/11/2025
1.7.37 22 12/20/2025
1.7.36 21 12/20/2025
1.7.35 31 01/06/2026
1.7.34 27 12/11/2025
1.7.33 26 12/16/2025
1.7.32 26 12/15/2025
1.7.31 30 12/20/2025
1.7.30 25 12/13/2025
1.7.29 26 12/14/2025
1.7.28 26 12/20/2025
1.7.27 22 12/20/2025
1.7.26 21 12/17/2025
1.7.25 30 12/09/2025
1.7.24 22 12/20/2025
1.7.23 24 12/20/2025
1.7.22 28 12/11/2025
1.7.21 23 12/10/2025
1.7.20 34 12/14/2025
1.7.19 27 12/13/2025
1.7.18 27 12/13/2025
1.7.17 33 12/10/2025
1.7.16 31 12/21/2025
1.7.15 26 12/20/2025
1.7.14 27 12/13/2025
1.7.13 27 12/15/2025
1.7.12 24 12/17/2025
1.7.11 25 12/16/2025
1.7.10 28 12/16/2025
1.7.9 32 12/12/2025
1.7.8 20 12/21/2025
1.7.7 27 12/20/2025
1.7.6 27 12/16/2025
1.7.5 27 12/16/2025
1.7.4 22 12/19/2025
1.7.3 28 12/20/2025
1.7.2 25 12/17/2025
1.7.1 31 12/20/2025
1.7.0 24 12/22/2025
1.6.30 25 12/15/2025
1.6.29 28 12/17/2025
1.6.28 27 12/13/2025
1.6.27 23 12/26/2025
1.6.26 24 12/15/2025
1.6.25 29 12/10/2025
1.6.24 28 12/20/2025
1.6.23 26 12/14/2025
1.6.22 29 12/10/2025
1.6.21 29 12/17/2025
1.6.20 34 12/17/2025
1.6.19 26 12/20/2025
1.6.18 24 12/15/2025
1.6.17 26 12/15/2025
1.6.16 31 12/16/2025
1.6.15 32 12/17/2025
1.6.14 22 01/06/2026
1.6.13 28 12/11/2025
1.6.12 24 12/17/2025
1.6.11 29 12/17/2025
1.6.10 30 12/20/2025
1.6.9 27 12/20/2025
1.6.8 29 12/14/2025
1.6.7 28 12/16/2025
1.6.6 25 12/23/2025
1.6.5 25 12/17/2025
1.6.4 33 12/19/2025
1.6.3 32 12/16/2025
1.6.2 26 12/13/2025
1.6.1 25 12/16/2025
1.6.0 26 12/11/2025
1.5.9 27 12/11/2025
1.5.8 32 12/15/2025
1.5.7 22 12/15/2025
1.5.6 23 12/20/2025
1.5.5 26 12/20/2025
1.5.4 26 12/20/2025
1.5.3 23 12/20/2025
1.5.2 26 12/20/2025
1.5.1 24 12/20/2025
1.5.0 31 12/11/2025
1.4.7 22 12/12/2025
1.4.6 24 12/13/2025
1.4.5 23 12/20/2025
1.4.4 26 12/20/2025
1.4.3 25 12/20/2025
1.4.2 22 12/16/2025
1.4.1 20 01/01/2026
1.3.4 24 12/15/2025
1.3.3 20 12/21/2025
1.3.2 28 12/18/2025
1.3.1 26 12/17/2025
1.3.0 31 12/14/2025
1.2.2 29 12/10/2025
1.2.1 22 12/12/2025
1.2.0 21 01/09/2026
1.1.1 24 12/20/2025
1.1.0 28 12/23/2025
1.0.2 25 12/17/2025
1.0.1 26 12/14/2025
1.0.0 28 12/20/2025
0.9.1 19 12/17/2025
0.9.0 22 12/20/2025
0.8.3 24 12/19/2025
0.8.2 32 12/20/2025
0.8.1 26 12/10/2025
0.8.0 32 12/14/2025
0.7.5 26 12/20/2025
0.7.4 35 12/20/2025
0.7.3 23 12/20/2025
0.7.2 25 12/17/2025
0.7.1 25 12/20/2025
0.7.0 33 01/13/2026
0.6.2 28 12/19/2025
0.6.1 26 01/01/2026
0.6.0 23 12/20/2025
0.5.2 22 12/20/2025
0.5.1 22 12/16/2025
0.5.0 31 12/20/2025