Fusonic.Extensions.Hangfire 10.0.0

Prefix Reserved
dotnet add package Fusonic.Extensions.Hangfire --version 10.0.0
                    
NuGet\Install-Package Fusonic.Extensions.Hangfire -Version 10.0.0
                    
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="Fusonic.Extensions.Hangfire" Version="10.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Fusonic.Extensions.Hangfire" Version="10.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Fusonic.Extensions.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 Fusonic.Extensions.Hangfire --version 10.0.0
                    
#r "nuget: Fusonic.Extensions.Hangfire, 10.0.0"
                    
#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 Fusonic.Extensions.Hangfire@10.0.0
                    
#: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=Fusonic.Extensions.Hangfire&version=10.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Fusonic.Extensions.Hangfire&version=10.0.0
                    
Install as a Cake Tool

Hangfire

Out-Of-Band Processing of CQRS Command and Event-Handlers

When applying CQRS, it allows us to easily decorate handlers with generic decorators. By applying the Fusonic.Extensions.Common.OutOfBandAttribute, you can decorate handlers which are allowed to run outside of the current flow. Whenever this handler gets called, the execution pipeline looks for the attribute on the handler. If the attribute is available, the handler is scheduled for async execution, meaning it runs “out of band” of the current logical flow. That means that the message will be stored in the outbox as part of the current ACID transaction and so it gets scheduled for async background processing as soon as the current transaction completes.

This way we you can atomically perform your business operation including scheduling commands/events which must be executed afterwards, so that we get into an consistent state.

Registration:

Container.RegisterOutOfBandDecorators();
Container.RegisterDecorator(typeof(IRequestHandler<,>), typeof(TransactionalRequestHandlerDecorator<,>));

If you want to process notifications out of band it is important to call Container.RegisterOutOfBandDecorators() before you register any other decorator. Otherwise this would cause the NotificationDispatcher to try to resolve a decorator instead of the actual NotificationHandler.

Usage:

[OutOfBand]
public class SendEmailCommandHandler : IRequestHandler<SendEmailCommand>
{
     ...
}

DisableHangfireDashboardAuthorizationFilter

For local development, where you have other means of authorization, you may want to disable the hangfire authorization for the dashboard.

For disabling the local development authorization for local development, you usually just can use the default options. However, those may not work when running the backend in a docker container, as hangfire still filters the requests to "only local requests". To completly disable any authorization use this filter instead.

Usage:

dashboardOptions = new DashboardOptions { Authorization = new[] { new DisableHangfireDashboardAuthorizationFilter() } };
app.UseHangfireDashboard(options: dashboardOptions);

Transactional job processor

If you want all your background jobs to run within a transaction (which is usually the case), you can use the TransactionalJobProcessor.

Configuration with SimpleInjector:

Container.RegisterSingleton<ITransactionScopeHandler, TransactionScopeHandler>();

// Transaction scope for all request handlers:
Container.RegisterDecorator(typeof(IRequestHandler<,>), typeof(TransactionalCommandHandlerDecorator<,>));

// Transaction scope for all notification handlers:
Container.RegisterDecorator(typeof(INotificationHandler<>), typeof(TransactionalNotificationHandlerDecorator<>));

Using DisplayNameFunc.DisplayNameFunc

OutOfBand jobs are processed via IJobProcessor.ProcessAsync. As a consequence, each jobs name in hangfires dashboard will be listed as "JobProcessor.ProcessAsync".
Fortunately there is an easy way to enable meaningful job display names:

dashboardOptions.DisplayNameFunc = DashboardHelpers.FormatJobDisplayName;

Once enabled, request handlers type name (without assembly information) will be used as the job display name.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.0.0 270 11/25/2025
10.0.0-rc.2 156 11/24/2025
10.0.0-rc.1 118 9/12/2025
9.5.4 578 8/20/2025
9.5.3 492 3/28/2025
9.5.2 537 1/16/2025
9.5.0 292 10/4/2024
9.4.0 364 9/23/2024
9.3.1 295 9/11/2024
9.3.0 229 9/11/2024
9.2.0 238 8/8/2024
9.2.0-rc.3 106 8/7/2024
9.2.0-rc.2 74 8/5/2024
9.2.0-rc.1 93 8/1/2024
9.1.0 187 7/29/2024
9.0.0 844 7/17/2024
9.0.0-preview.2 97 6/13/2024
9.0.0-preview.1 109 4/5/2024
8.1.3 333 3/27/2024
8.1.2 226 3/27/2024
8.1.1 287 3/1/2024
8.1.0 395 1/26/2024
8.0.1 926 12/18/2023
8.0.1-rc.2 117 12/7/2023
8.0.1-rc.1 110 12/6/2023
8.0.0 1,218 11/21/2023
8.0.0-preview1 175 10/4/2023
7.4.0 219 1/25/2024
7.3.0 259 10/11/2023
7.2.1-rc.1 155 8/28/2023
7.2.0 615 6/28/2023
7.2.0-alpha.1 175 6/27/2023
7.1.2 559 5/25/2023
7.1.1 1,014 4/3/2023
7.1.1-rc.2 188 3/30/2023
7.1.1-rc.1 181 3/30/2023
7.1.0 932 2/28/2023
7.1.0-rc.1 193 2/20/2023
7.0.4-rc.5 203 2/23/2023
7.0.4-rc.4 191 2/23/2023
7.0.4-rc.3 190 2/23/2023
7.0.4-rc.2 198 2/22/2023
7.0.4-rc.1 195 2/16/2023
7.0.3 529 2/16/2023
7.0.2 416 2/9/2023
7.0.2-rc.1 208 2/2/2023
7.0.1 866 1/26/2023
7.0.0 472 1/24/2023
7.0.0-preview1 291 7/18/2022
7.0.0-beta.9 224 1/24/2023
7.0.0-beta.8 206 1/23/2023
7.0.0-beta.7 201 1/23/2023
7.0.0-beta.6 206 1/23/2023
7.0.0-beta.5 212 1/23/2023
7.0.0-beta.4 214 1/19/2023
7.0.0-beta.3 195 1/17/2023
7.0.0-beta.2 206 1/11/2023
7.0.0-beta.1 191 11/24/2022
6.2.2 16,433 9/20/2022
6.2.2-rc.1 234 9/19/2022
6.2.1 4,037 5/4/2022
6.2.0 691 4/21/2022
6.2.0-rc.2 255 4/21/2022
6.2.0-rc.1 257 4/20/2022
6.1.1 1,089 3/1/2022
6.1.0 769 2/10/2022
6.1.0-rc.3 253 2/10/2022
6.1.0-rc.2 254 2/10/2022
6.1.0-rc.1 257 2/9/2022
6.0.3 1,641 1/18/2022
6.0.2 2,781 1/10/2022
6.0.1 452 12/16/2021
6.0.0 795 12/13/2021
6.0.0-rc.6 278 12/6/2021
6.0.0-rc.5 473 12/6/2021
6.0.0-rc.4 627 12/6/2021
6.0.0-rc.3 516 12/6/2021
6.0.0-rc.2 484 12/6/2021
6.0.0-rc.1 770 11/15/2021
5.4.0 1,034 10/13/2021
5.3.0 660 9/23/2021
5.3.0-rc.1 477 9/17/2021
5.2.0 3,423 5/20/2021
5.2.0-rcjh.6 327 5/19/2021
5.2.0-rcjh.5 285 5/19/2021
5.2.0-rcjh.4 301 5/19/2021
5.2.0-rcjh.3 286 5/19/2021
5.2.0-rcjh.2 275 4/12/2021
5.2.0-rcjh.1 282 4/12/2021
5.1.3 504 5/19/2021
5.1.2 15,120 3/26/2021
5.1.1 1,225 1/13/2021
5.1.0 2,244 12/16/2020
5.0.0 2,664 11/17/2020
5.0.0-rc.1 443 10/15/2020
4.2.1 19,174 10/8/2020
4.2.0 7,572 8/25/2020
4.1.0 842 8/19/2020
4.0.2 682 8/19/2020
4.0.1 3,953 7/3/2020
4.0.0 701 6/17/2020
3.1.0 685 6/15/2020
3.0.0 10,195 2/4/2020
2.0.0 4,079 9/25/2019
1.0.2 5,273 6/24/2019