Open-source project
HangfireIO/Hangfire avatar
HangfireIO/Hangfire

Hangfire: background job processing inside your .NET application

An easy way to perform background job processing in .NET and .NET Core applications. No Windows Service or separate process required

10,157 stars1,754 forksC#NOASSERTION

At a glance

What is it?
Hangfire runs fire-and-forget, delayed and recurring jobs in the same process as your .NET app, with SQL Server, Redis, SQL Azure or MSMQ as the store. It suits teams that want a dashboard without standing up a separate worker service.
Who is it for?
Adopt Hangfire if you already run SQL Server or Redis and want background jobs and a dashboard without a separate Windows Service. Do not adopt it if you need a polyglot queue shared with non-.NET services.
Can I use it commercially?
Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
Is it still maintained?
Yes. The repository last received commits 15 days ago.
What is it written in?
Mainly C#, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 14, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • HangfireIO/Hangfire10,157 ★ · +17
Star history
Repository2026-09-222026-11-14
HangfireIO/Hangfire10.1k10.2k

17 Stars in the last 53 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The problem Hangfire removes: background work without a separate process

A web request that sends a newsletter, imports a CSV or builds an image holds a thread for the whole operation. The usual fix is to hand that work to a Windows Service, a Task Scheduler entry or a separate worker deployment, which means another thing to deploy, monitor and keep in sync with the web app's code. Hangfire takes the other route: the worker pool lives inside the application process, so the same binary that serves requests also executes queued jobs. The README states this directly, that no Windows Service or Task Scheduler is required.

The audience is .NET and .NET Core developers with a persistent store already in the stack. Storage options named in the README are Redis, SQL Server, SQL Azure and MSMQ. Workloads it lists include mass notifications, batch import from xml, csv or json, archive creation, web hooks, user deletion, graph building, image and video processing, temporary file purging, recurring reports and database maintenance. That list is broad on purpose: these are the jobs teams normally push into a scheduler, and Hangfire's claim is that one programming model covers all of them.

How the job store, worker pool and dashboard fit together

The mechanism is a persistent job store. When you call BackgroundJob.Enqueue, Hangfire writes a job record to the configured storage instead of executing it inline. A pool of dedicated worker threads, started by app.UseHangfireServer() or by a BackgroundJobServer instance, polls that store, picks up due jobs and runs them.

app.UseHangfireDashboard() mounts the dashboard, as in the README's setup code. Delayed jobs are executed only after a given amount of time. Recurring jobs are registered with a CRON expression through RecurringJob.AddOrUpdate and are scheduled by the server. Continuations chain jobs: BackgroundJob.ContinueWith(id, ...) takes the id returned by BackgroundJob.Enqueue.

Installing Hangfire and scheduling your first job

Hangfire ships as a NuGet package. The README gives the Package Manager Console command:

bash
PM> Install-Package Hangfire

After installation the README says to update the OWIN Startup class. The example configures SQL Server storage, starts the server and mounts the dashboard:

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

    app.UseHangfireServer();
    app.UseHangfireDashboard();
}

If the project has no OWIN Startup class, the README points to the Quick start guide at docs.hangfire.io rather than repeating the steps. Once the server is running, enqueueing work is a single call. The README's example writes to the console:

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

The expression is serialized, not executed at the call site, so the method runs later on a worker thread. Delayed and recurring jobs follow the same shape: BackgroundJob.Schedule with a TimeSpan for one-off delays, and RecurringJob.AddOrUpdate with Cron.Daily or another CRON expression for repeats.

The README also covers running outside a web host. A console application, Windows Service or Azure Worker Role can host the server by constructing a BackgroundJobServer in a using block and blocking on Console.ReadLine. That is the same worker pool, just started by your own entry point.

Where Hangfire is the wrong tool

The design assumes the job store is a relational database or Redis that your application already talks to, and it assumes the application process stays up. If your host recycles aggressively or runs on a platform that suspends idle processes, the worker pool goes with it. The README's claim that Hangfire is reliable on shared hosting does not remove the need for your host to keep the process alive.

The second constraint is polyglot. Hangfire is a .NET library, and the README frames it as a .NET alternative to Resque, Sidekiq, delayed_job and Celery. Those tools exist because their ecosystems wanted a queue that other languages can produce into and consume from. Hangfire jobs are declared as C# expressions, which a Python or Go service cannot produce directly. If your background work spans several runtimes, this is the wrong side of the fence.

Hangfire compared with Quartz.NET

Quartz.NET is the closest .NET alternative and the difference is architectural. Quartz is a scheduler: you define triggers and calendars, and it decides when a job fires. Hangfire is a queue with a scheduler attached. Enqueue is the primary verb, and recurring jobs are one feature among four job types rather than the centre of the model.

In practice that changes what you get out of the box. Hangfire's README leads with fire-and-forget, delayed and recurring jobs and the absence of a Windows Service or Task Scheduler. Quartz's model is oriented around trigger definitions and misfire policies, which is a richer vocabulary for calendar-shaped schedules. If your requirement is "run this at 09:00 on the last business day of each month with a documented misfire policy", Quartz expresses that more directly. If your requirement is "do this work outside the request, retry it, and show me the state", Hangfire's enqueue-first API is shorter. This is a reading of the two models, not a benchmark.

Licence, maintenance and upgrade cost

The README badge says LGPLv3, and the repository carries COPYING and COPYING.LESSER files alongside LICENSE.md, LICENSE_ROYALTYFREE, LICENSE_STANDARD and a NOTICES file. The repository metadata reports the licence as NOASSERTION, which means an automated classifier did not reach a single verdict from those files. Before shipping, read the actual licence files in the repository root.

Maintenance looks current rather than dormant. The last push to the default branch was on 2026-10-30, and releases are recent: v1.8.25 on 2026-08-28, v1.8.24 on 2026-07-16 and v1.8.23 on 2026-02-05. The version numbers stay in the 1.8.x line across those releases, so the upgrade cost between them is patch-level by version number alone.

Building from source has its own prerequisites: Razor Generator if you edit cshtml files, the MSMQ service installed, and an environment variable named Hangfire_SqlServer_ConnectionStringTemplate holding a connection string. The README instructs contributors to run the build command before proposing a pull request.

Editorial conclusion

Adopt Hangfire if you already run SQL Server or Redis and want background jobs and a dashboard without a separate Windows Service. Do not adopt it if you need a polyglot queue shared with non-.NET services. Verify first that your hosting model keeps the process alive long enough for the worker pool, and check the LGPLv3 terms against how you ship the assemblies.

Frequently asked questions

What is Hangfire used for?

It performs fire-and-forget, delayed and recurring background jobs in .NET applications, so work that would otherwise block a request runs on a worker pool instead. The README lists newsletters, batch imports, archive creation, web hooks and recurring reports as typical uses.

How does Hangfire work?

Enqueueing a job writes a record to the configured storage, and dedicated worker pool threads pick up due jobs and execute them. The same store backs the dashboard.

How to install Hangfire?

It is a NuGet package. The README gives the Package Manager Console command Install-Package Hangfire. After installing, the README says to configure storage and call UseHangfireServer in your OWIN Startup class.

How to use the Hangfire dashboard?

Call app.UseHangfireDashboard() in the same Startup configuration where you start the server. The README example mounts it alongside UseHangfireServer.

What is Hangfire in C#?

It is a library that adds background job processing to .NET and .NET Core applications, with storage backed by Redis, SQL Server, SQL Azure or MSMQ. Jobs are declared as C# expressions such as BackgroundJob.Enqueue(() => Console.WriteLine("Simple!")).

Official sources

  1. HangfireIO/Hangfire on GitHub
  2. Issues
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/hangfireio-hangfire.svg)](https://hysenlabs.com/projects/hangfireio-hangfire)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/hangfireio-hangfire.svg)](https://hysenlabs.com/projects/hangfireio-hangfire)

Was this useful?