RepletoryLib.BackgroundJobs.Hangfire 1.0.0

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

RepletoryLib.BackgroundJobs.Hangfire

Hangfire implementation of IBackgroundJobService with dashboard, storage options, and logging filters.

Part of the RepletoryLib ecosystem -- standalone, reusable .NET 10 libraries with zero business logic.

NuGet .NET 10 License: MIT


Overview

RepletoryLib.BackgroundJobs.Hangfire implements IBackgroundJobService from RepletoryLib.BackgroundJobs.Abstractions using Hangfire. It supports fire-and-forget, scheduled, and recurring jobs with SQL Server or in-memory storage, a built-in dashboard, and logging filters.

Key Features

  • Fire-and-forget -- Enqueue jobs for immediate background execution
  • Scheduled jobs -- Execute after a specified delay
  • Recurring jobs -- Cron-based scheduling with add/update/remove
  • Dashboard -- Built-in web UI for monitoring jobs
  • Storage options -- SQL Server persistence or in-memory (development)
  • Logging filter -- Automatic logging of job lifecycle events

Installation

dotnet add package RepletoryLib.BackgroundJobs.Hangfire

Dependencies

Package Type
RepletoryLib.BackgroundJobs.Abstractions RepletoryLib
Hangfire.Core NuGet (1.8.18)
Hangfire.AspNetCore NuGet
Hangfire.SqlServer NuGet
Hangfire.InMemory NuGet

Quick Start

using RepletoryLib.BackgroundJobs.Hangfire;

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddRepletoryHangfire(builder.Configuration);

var app = builder.Build();
app.UseRepletoryHangfire(); // Enables dashboard
{
  "Hangfire": {
    "StorageType": "SqlServer",
    "ConnectionString": "Server=localhost,1433;Database=MyApp;User Id=sa;Password=Repletory@123!;TrustServerCertificate=true",
    "WorkerCount": 4,
    "EnableDashboard": true,
    "DashboardPath": "/hangfire",
    "DashboardRequireAuth": true
  }
}

Configuration

HangfireOptions

Property Type Default Description
StorageType HangfireStorageType InMemory SqlServer or InMemory
ConnectionString string? null SQL Server connection (required for SqlServer)
WorkerCount int CPU count Number of background worker threads
EnableDashboard bool true Enable Hangfire dashboard UI
DashboardPath string "/hangfire" Dashboard URL path
DashboardRequireAuth bool true Require authentication for dashboard

Usage Examples

Fire-and-Forget

using RepletoryLib.BackgroundJobs.Abstractions.Interfaces;

await _jobs.EnqueueAsync(() => _emailService.SendWelcomeEmailAsync(userId));

Scheduled Jobs

await _jobs.ScheduleAsync(
    () => _reminderService.SendReminderAsync(orderId),
    TimeSpan.FromHours(24));

Recurring Jobs

// Daily at 6 AM
await _jobs.AddOrUpdateRecurringAsync("daily-report",
    () => _reportService.GenerateDailyAsync(), "0 6 * * *");

// Remove
await _jobs.RemoveRecurringAsync("daily-report");

Integration with Other RepletoryLib Packages

Package Relationship
RepletoryLib.BackgroundJobs.Abstractions Implements IBackgroundJobService
RepletoryLib.Workers Alternative for long-running polling/queue workers
RepletoryLib.Logging Job lifecycle logged via Serilog
RepletoryLib.HealthChecks Monitor Hangfire storage health

License

This project is licensed under the MIT License.

Copyright (c) 2024-2026 Repletory.


For complete documentation, infrastructure setup, and configuration reference, see the RepletoryLib main repository.

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
1.0.0 62 3/2/2026