Hangfire 1.8.25

Prefix Reserved
dotnet add package Hangfire --version 1.8.25
                    
NuGet\Install-Package Hangfire -Version 1.8.25
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Hangfire" Version="1.8.25" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Hangfire" Version="1.8.25" />
                    
Directory.Packages.props
<PackageReference Include="Hangfire" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Hangfire --version 1.8.25
                    
#r "nuget: Hangfire, 1.8.25"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Hangfire@1.8.25
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Hangfire&version=1.8.25
                    
Install as a Cake Addin
#tool nuget:?package=Hangfire&version=1.8.25
                    
Install as a Cake Tool

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.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

NuGet packages (255)

Showing the top 5 NuGet packages that depend on Hangfire:

Package Downloads
Ekom.Core

Ekom - E-Commerce solution for Umbraco

N3O.Umbraco.Scheduler

TODO

Bnsights.Mvc

Bnsights.Mvc is RAD Helper DLL for MVC Projects in Bnsights DMCC. Also known as Bnsights Business Solutions Framework (BBSF).

ImmediaC.SimpleCms

ASP.NET Core based CMS

ComplianceAuditSystems.AcabimCommonServices

Package Description

GitHub repositories (35)

Showing the top 20 popular GitHub repositories that depend on Hangfire:

Repository Stars
Kareadita/Kavita
Kavita is a fast, feature rich, cross platform reading server. Built with the goal of being a full solution for all your reading needs. Setup your own server and share your reading collection with your friends and family.
fullstackhero/dotnet-starter-kit
Production Grade Cloud-Ready .NET 10 Starter Kit (Web API + React Client) with Multitenancy Support, and Clean/Modular Architecture that saves roughly 200+ Development Hours! All Batteries Included.
fullstackhero/blazor-starter-kit
Clean Architecture Template for Blazor WebAssembly Built with MudBlazor Components.
dotnetcore/osharp
OSharp是一个基于.Net6.0的快速开发框架,框架对 AspNetCore 的配置、依赖注入、日志、缓存、实体框架、Mvc(WebApi)、身份认证、功能权限、数据权限等模块进行更高一级的自动化封装,并规范了一套业务实现的代码结构与操作流程,使 .Net 框架更易于应用到实际项目开发中。
altmann/FluentResults
A generalised Result object implementation for .NET/C#
CoreUnion/CoreShop
基于 Asp.Net Core 9.0、Uni-App开发,支持可视化布局的小程序商城系统,前后端分离,支持分布式部署,跨平台运行,拥有分销、代理、团购、拼团、秒杀、直播、优惠券、自定义表单等众多营销功能,拥有完整SKU、下单、售后、物流流程。支持一套代码编译发布微信小程序版、H5版、Android版、iOS版、支付宝小程序版、字节跳动小程序版、QQ小程序版等共10个平台。
VirtoCommerce/vc-platform
Virto Commerce B2B Innovation Platform
CodeMazeBlog/CodeMazeGuides
The main repository for all the Code Maze guides
trueai-org/module-shop
一个基于 .NET 8.0 构建的简单、跨平台、模块化的商城系统
cofoundry-cms/cofoundry
Cofoundry is an extensible and flexible .NET Core CMS & application framework focusing on code first development
HTBox/allReady
This repo contains the code for allReady, an open-source solution focused on increasing awareness, efficiency and impact of preparedness campaigns as they are delivered by humanitarian and disaster response organizations in local communities.
lingarr-translate/lingarr
Lingarr is an application that supports both local and SaaS translation services to translate subtitle files into a specified target language. With automated translation options, Lingarr simplifies translating subtitles.
masastack/MASA.Framework
.NET next-generation microservice development framework, which provides cloud native best practices based on Dapr.
DevArchitecture/DevArchitecture
DevArchitecture Backend Project
q315523275/FamilyBucket
集合.net core、ocelot、consul、netty、rpc、eventbus、configserver、tracing、sqlsugar、vue-admin、基础管理平台等构建的微服务一条龙应用
revoframework/Revo
Event Sourcing, CQRS and DDD framework for C#/.NET Core.
DataDog/dd-trace-dotnet
.NET Client Library for Datadog APM
Dynatrace/superdump
A service for automated crash-dump analysis
CervantesSec/cervantes
Cervantes is an open-source, collaborative platform designed specifically for pentesters and red teams. It serves as a comprehensive management tool, streamlining the organization of projects, clients, vulnerabilities, and reports in a single, centralized location.
mehdihadeli/food-delivery-modular-monolith
🌭 A practical and imaginary food and grocery delivery modular monolith, built with .Net 8, Domain-Driven Design, CQRS, Vertical Slice Architecture, Event-Driven Architecture, and the latest technologies.
Version Downloads Last Updated
1.8.25 2,456 8/28/2026
1.8.24 483,053 7/16/2026
1.8.23 3,292,923 2/5/2026
1.8.22 2,992,455 11/7/2025
1.8.21 2,818,637 8/12/2025
1.8.20 3,374,938 5/16/2025
1.8.19 76,359 5/16/2025
1.8.18 4,310,637 2/17/2025
1.8.17 2,978,301 12/3/2024
1.8.16 285,326 11/27/2024
1.8.15 1,665,756 10/23/2024
1.8.14 5,817,494 6/11/2024
1.8.12 3,413,769 4/3/2024
1.8.11 1,601,322 2/23/2024
1.8.10 567,104 2/12/2024
1.8.9 795,659 1/24/2024
1.8.7 955,873 12/29/2023
1.7.37 481,579 4/8/2024
Loading failed

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.