Hangfire 1.8.24
Prefix Reserveddotnet add package Hangfire --version 1.8.24
NuGet\Install-Package Hangfire -Version 1.8.24
<PackageReference Include="Hangfire" Version="1.8.24" />
<PackageVersion Include="Hangfire" Version="1.8.24" />
<PackageReference Include="Hangfire" />
paket add Hangfire --version 1.8.24
#r "nuget: Hangfire, 1.8.24"
#:package Hangfire@1.8.24
#addin nuget:?package=Hangfire&version=1.8.24
#tool nuget:?package=Hangfire&version=1.8.24
Hangfire
Build Status
main |
dev |
|
|---|---|---|
| AppVeyor |
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.
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.
Dedicated worker pool threads execute queued background jobs as soon as possible, shortening your request's processing time.
BackgroundJob.Enqueue(() => Console.WriteLine("Simple!"));
Scheduled background jobs are executed only after a given amount of time.
BackgroundJob.Schedule(() => Console.WriteLine("Reliable!"), TimeSpan.FromDays(7));
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.
Related Projects
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/.
Legal
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.
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.5.1
- Hangfire.Core (= 1.8.24)
- Hangfire.SqlServer (= 1.8.24)
- Microsoft.Owin.Host.SystemWeb (>= 3.0.0)
-
.NETStandard 1.3
- Hangfire.AspNetCore (= 1.8.24)
- Hangfire.Core (= 1.8.24)
- Hangfire.SqlServer (= 1.8.24)
-
.NETStandard 2.0
- Hangfire.AspNetCore (= 1.8.24)
- Hangfire.Core (= 1.8.24)
- Hangfire.SqlServer (= 1.8.24)
NuGet packages (252)
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.24 | 338,079 | 7/16/2026 |
| 1.8.23 | 3,129,724 | 2/5/2026 |
| 1.8.22 | 2,928,472 | 11/7/2025 |
| 1.8.21 | 2,760,932 | 8/12/2025 |
| 1.8.20 | 3,317,051 | 5/16/2025 |
| 1.8.19 | 76,158 | 5/16/2025 |
| 1.8.18 | 4,250,907 | 2/17/2025 |
| 1.8.17 | 2,944,945 | 12/3/2024 |
| 1.8.16 | 283,034 | 11/27/2024 |
| 1.8.15 | 1,648,786 | 10/23/2024 |
| 1.8.14 | 5,751,066 | 6/11/2024 |
| 1.8.12 | 3,379,051 | 4/3/2024 |
| 1.8.11 | 1,589,481 | 2/23/2024 |
| 1.8.10 | 562,167 | 2/12/2024 |
| 1.8.9 | 790,790 | 1/24/2024 |
| 1.8.7 | 949,964 | 12/29/2023 |
| 1.8.6 | 2,498,226 | 10/18/2023 |
| 1.7.37 | 475,134 | 4/8/2024 |
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.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.
1.8.19
Hangfire.Core
• Changed – Update Bootstrap to the custom version of 3.4.2 to avoid false alerts on unused features.
• Fixed – Typos in Portuguese translation (by @VianaArthur).
• Fixed – Unnecessary recurring job update transaction when nothing is changed after an error.
Hangfire.SqlServer
• Fixed – Sliding invisibility timeout isn't prolonged in lightweight servers, causing jobs to be restarted.
1.8.18
Hangfire.Core
• Added – `DashboardOptions.ServerPossiblyAbortedThreshold` to configure a custom threshold for "possibly aborted" warnings.
• Fixed – Expired jobs are still shown on the "Retries" page in some cases.
• Fixed – Issues with `CultureInfo`-related differences after upgrading to 1.8.15–1.8.17.
• Fixed – Don't leak `AsyncLocal` values from synchronous background job methods.
• Fixed – Don't throw an exception when passing the `Job.Args` property to the `Job` class' constructor.
• Project – Make the lock file usable for both .NET 8.0 and .NET 9.0 builds.
• Project – Make code generation for `cshtml` files working on newer platforms.
Hangfire.AspNetCore
• Fixed – Swallow possible `ObjectDisposedException` in the `StopAsync` method.
• Fixed – Avoid `NullReferenceException` when `LocalIpAddress` or `RemoteIpAddress` is null.
1.8.17
Hangfire.SqlServer
• Fixed – `InvalidCastException` while fetching a job with older schemas regression from 1.8.16.
1.8.16
Hangfire.Core
• Changed – Include fewer stack frames in exceptions come from `IServerFilter` implementations.
• Changed – Don't include file information in the `ExceptionDetails` property of a FailedState instance.
• Changed – Switch back to `CancellationEvent` usage instead of `CancellationToken.WaitHandle`.
• Fixed – Don't commit external transaction in the `BackgroundJobStateChanger` implementation.
• Fixed – Use safe default serializer settings for Newtonsoft.Json 12.X and below.
• Project – Fix builds for the `net451` platform when using .NET 9.0.
• Project – Significantly reduce execution time of unit tests in the `RecurringJobSchedulerFacts` class.
• Project – Bump `Microsoft.CodeAnalysis.NetAnalyzers` package to version 9.0.0.
Hangfire.SqlServer
• Changed – Use vanilla ADO.NET when fetching a job in the `SqlServerJobQueue` implementation.
• Fixed – SqlException: Must declare the scalar variable "@key" in delayed and recurring job schedulers.
• Fixed – Decrease the `LockTimeout` time when calling the `sp_getapplock` procedure to 1 second for less blocking.
• Project – Disable parallel tests execution when building under .NET 9.0.
• Project – Run tests over the latest Microsoft.Data.SqlClient package and the `net6.0` platform.
• Project – Reduce execution time of integration tests.
• Project – Disable `PoolBlockingPeriod` setting on AppVeyor to handle transient test failures.
1.8.15
Hangfire.Core
• Added – New `AutomaticRetryAttribute.ExceptOn` property to skip retries for specific exceptions.
• Changed – Refactor filters pipeline to use less LINQ magic and fewer allocations.
• Changed – Use `GetCultureInfo` instead of creating an instance in the `CaptureCultureAttribute` filter.
• Changed – Cache some immutable data to avoid extra allocations.
• Fixed – Improve loopback address detection (by @meziantou).
• Fixed – Reformulate misleading error messages regarding retry timings (by @RGFuaWVs).
• Fixed – Problem with missing localizations in the previous version.
• Fixed – Don't hide exception details on Failed Jobs page when the exception message is empty.
• Fixed – Problems with the first restore when using the `build.bat` command.
• Fixed – Better display of canceled recurring jobs in dashboard.
• Fixed – Less overall allocations with using static delegates and struct-based iterators.
• Fixed – Improve precision of some diagnostic messages in the wait protection logic.
• Fixed – Make all private and internal classes sealed to improve code consistency.
• Fixed – Less overall pressure on garbage collector.
Hangfire.SqlServer
• Changed – Use query template caching based on schema name to avoid excessive `string` allocations.
• Changed – Use static callbacks almost anywhere to avoid unnecessary delegate allocations.
• Changed – Use `QuerySingle`* or `ReadSingle`* where possible to avoid allocating lists.
• Changed – Unify `DbCommand` and `DbParameter` creation logic to improve code consistency.
1.8.13 and 1.8.14
Hangfire.Core
• Changed – Partial cache for serialization and deserialization in `InvocationData` to produce less strings.
• Changed – Add caching for default type serializer and resolver.
• Changed – Don't let `JobFilter`-related logic to show up in profilers.
• Changed – Modify `IProfiler` to be less allocatey for diagnostic purposes that almost never run.
• Changed – Prefer using `CancellationToken.WaitHandle` again, since early .NET Core days are gone.
• Changed – Fewer allocations when working with `IStateHandler` collections in a state machine.
• Fixed – Redirect the "System.Private.Xml.Linq" assembly to the "System.Xml.Linq" one for better interoperability.
• Fixed – Don't throw `KeyNotFoundException` when recurring job is malformed.
• Fixed – Proper relative path calculation in `UrlHelper.To` for OWIN-based Dashboard UI (by @LordJZ).
• Fixed – Typo in the Turkish localization file (by @ismkdc).
• Project – Switch to a modern PowerShell 7+ to speed up SignPath installation on AppVeyor.
Hangfire.SqlServer
• Changed – Limit polling queries when queues are empty with a semaphore for all configurations.
• Changed – Use per-queue signaling for same-process workers, instead of having a global signal.
• Fixed – Don't silently truncate queue names, throw an exception instead.
• Project – Decrease delays in SQL Server-related tests to complete them faster.
1.8.12
Hangfire.Core
• Added – `MaxDegreeOfParallelismForSchedulers` experimental server option if supported by storage.
• Added – Experimental support for parallel execution of the delayed job scheduler.
• Added – Experimental support for parallel execution of the recurring job scheduler.
• Fixed – Recurring job is scheduled to the past after recovering from error with `AddOrUpdate`.
• Fixed – `AddOrUpdate` triggers execution of a recurring job, even if its next execution is in the future.
• Fixed – Two very minor errors in the Swedish localization file (by @Uglack).
Hangfire.SqlServer
• Fixed – Populate `InvocationData` and `LoadException` properties in `JobDetails` method results.
1.8.11
Hangfire.Core
• Changed – Add icons and fix metadata for NuGet packages.
• Changed – Bump ILRepack to version 2.0.27 to avoid problems with internalizing.
• Fixed – "Type exists in both Cronos and Hangfire.Core" exception.
1.8.10
Hangfire.Core
• Changed – Added Norwegian translations for new keys (by @khellang).
• Changed – Update Brazilian Portuguese translation (by @HugoAlames).
• Changed – Bump Cronos dependency to version 0.8.3.
Hangfire.AspNetCore
• Fixed – Don't check `HasStarted` in `Response.WriteAsync` to avoid breaking dispatchers.
Hangfire.SqlServer
• Changed – Bump Dapper for the `netstandard2.0` platform to version 2.1.28.
• Changed – Bump Dapper for `net451` and `netstandard1.3` platforms to version 1.60.6.
Hangfire.Core, Hangfire.NetCore, Hangfire.AspNetCore, Hangfire.SqlServer, Hangfire.SqlServer.Msmq
• Project – Enable NuGet package and DLL signing with a company certificate.
• Project – Require NuGet package signature validation on restore for dependencies.
• Project – Add `HangfireIO` as a package owner.
1.8.9
Hangfire.Core
• Changed – Use `Environment.MachineName` as a server name if other environment vars aren't available.
• Changed – Bump the Cronos package version from 0.7.1 to 0.8.1.
• Changed – Improve portuguese translations (by @filipe-silva).
• Fixed – Possible `NullReferenceException` on the Deleted Jobs page (regression from 1.8.7).
• Project – Enable full source link support with embedded symbols and repository-based sources.
• Project – Enable repeatable package restore using a lock file.
• Project – Run unit tests against the `net6.0` platform.
• Project – Modernise the build system and clean up the build scripts.
Hangfire.SqlServer
• Project – Enable full source link support with embedded symbols and repository-based sources.
• Project – Enable repeatable package restore using a lock file.
• Project – Run unit tests against the `net6.0` platform.
Hangfire.NetCore
• Project – Enable full source link support with embedded symbols and repository-based sources.
• Project – Enable repeatable package restore using a lock file.
Hangfire.AspNetCore
• Fixed – Don't attempt to write response headers when response has already started (by @maliming).