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
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 and retries 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, retries and a dashboard without a separate Windows Service. Do not adopt it if you need a polyglot queue shared with non-.NET services, or if you cannot grant the job store the schema changes Hangfire applies.
- 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 7 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 September 30, 2026, and from our analysis. They are not legal advice.
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 queue in your database. 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. Because the queue is the database, a process restart does not lose queued work, and several application instances can share the same store.
That shared store is also what makes the dashboard work. app.UseHangfireDashboard() mounts a UI that reads job state from the same tables, which is why the README can show a dashboard screenshot next to the setup code. Delayed jobs are stored with a due time and become eligible when it passes. Recurring jobs are registered with a CRON expression through RecurringJob.AddOrUpdate and are scheduled by the server. Continuations are stored as a link from a parent job id to a child, so BackgroundJob.ContinueWith(id, ...) runs only after the parent finishes. All four job types are rows in one store, which is the design decision that keeps the API small.
Installing Hangfire and scheduling your first job
Hangfire ships as a NuGet package. The README gives the Package Manager Console command:
PM> Install-Package HangfireAfter installation the README says to update the OWIN Startup class. The example configures SQL Server storage, starts the server and mounts the dashboard:
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:
BackgroundJob.Enqueue(() => Console.WriteLine("Simple!"));The expression is serialized, not executed at the call site, so the method runs later on a worker thread. After that call you should see the job appear in the dashboard and then move to a succeeded state. 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, and the README does not document a watchdog for that case. The README's claim that Hangfire is reliable on shared hosting should be read as a statement about job persistence, not about the host keeping your 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 does not offer that; a Python or Go service cannot enqueue a Hangfire job through a documented protocol in this material. If your background work spans several runtimes, this is the wrong side of the fence.
The README is also silent on operational details that matter at scale: it does not document rollback of the storage schema, retention of succeeded job history, or what happens when two servers race for the same job beyond the fact that the store is shared. Treat those as questions for your own testing, not as documented behaviour.
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 the dashboard, the persistent store and the absence of a separate process. 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. The README does not compare the two, so 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; this article cannot tell you what your distribution obligations are.
Maintenance looks current rather than dormant. The last push to the default branch was on 2026-09-21, 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. The README does not publish a support policy or a deprecation timeline, so nothing in this material tells you how long a given 1.8.x release will receive fixes.
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, retries and a dashboard without a separate Windows Service. Do not adopt it if you need a polyglot queue shared with non-.NET services, or if you cannot grant the job store the schema changes Hangfire applies. 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, and several application instances can share it.
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 dashboard reads job state from the configured storage, which is why it is mounted alongside UseHangfireServer in the README example.
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
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.
[](https://hysenlabs.com/projects/hangfireio-hangfire)