Masterly.NightShift 1.0.0

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

Masterly.NightShift

Reliable background jobs for .NET: fire-and-forget, delayed, recurring and continuation jobs, persisted to a storage you already run, with a built-in dashboard.

NuGet

This meta-package installs the core library, SQL Server storage and the ASP.NET Core integration, for ASP.NET Core apps. Worker Services and console apps take only the packages they use:

Package What it is
Masterly.NightShift This meta-package: Core + SqlServer + AspNetCore
Masterly.NightShift.Core Jobs, the server, filters, the dashboard
Masterly.NightShift.SqlServer SQL Server storage
Masterly.NightShift.NetCore Microsoft.Extensions.* integration (DI, hosted service)
Masterly.NightShift.AspNetCore Dashboard middleware, endpoint mapping, health checks

Every package targets net8.0 and net10.0, so it runs on .NET 8 and later. The SQL Server storage uses Microsoft.Data.SqlClient.

dotnet add package Masterly.NightShift

Example

An ASP.NET Core app:

using Masterly.NightShift;

var builder = WebApplication.CreateBuilder(args);

var connectionString = builder.Configuration.GetConnectionString("NightShift")
    ?? throw new InvalidOperationException("Connection string 'NightShift' is missing.");

builder.Services.AddNightShift(config => config.UseSqlServerStorage(connectionString));
builder.Services.AddNightShiftServer();

var app = builder.Build();

// The storage is set up once the services are built, so create jobs after Build()
app.Services.GetRequiredService<IBackgroundJobClient>()
    .Enqueue(() => Console.WriteLine("Hello from a background job"));
app.Services.GetRequiredService<IRecurringJobManager>()
    .AddOrUpdate("nightly-cleanup", () => Maintenance.Cleanup(), Cron.Daily());

app.MapNightShiftDashboard();   // served at /nightshift
app.Run();

public static class Maintenance
{
    public static void Cleanup() => Console.WriteLine("Cleaning up");
}

Documentation

Job types, retries and other filters, the server, the dashboard and monitoring are covered in the full documentation: https://a7mdfre7at.github.io/Masterly.NightShift/. Start with Quick start: ASP.NET Core. Coming from Hangfire? See Migrating from Hangfire.

License

This package is MIT and contains no code. The packages it installs (Core, SqlServer and AspNetCore) are MIT AND LGPL-3.0-or-later: code written for Masterly.NightShift is MIT, code derived from Hangfire stays under the LGPL, and each of them contains both license texts.

There are no supported framework assets in this 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 0 11/16/2026