Masterly.NightShift.Core 1.0.0

dotnet add package Masterly.NightShift.Core --version 1.0.0
                    
NuGet\Install-Package Masterly.NightShift.Core -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.Core" 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.Core" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Masterly.NightShift.Core" />
                    
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.Core --version 1.0.0
                    
#r "nuget: Masterly.NightShift.Core, 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.Core@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.Core&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Masterly.NightShift.Core&version=1.0.0
                    
Install as a Cake Tool

Masterly.NightShift.Core

The core of Masterly.NightShift: fire-and-forget, delayed, recurring and continuation background jobs, the job server, filters (retries, concurrency limits, timeouts and more) and the dashboard. Jobs are stored in a storage package you add next to it, such as Masterly.NightShift.SqlServer.

NuGet

Install

ASP.NET Core apps usually install the Masterly.NightShift meta-package instead. Install the core directly for a console app or a Windows Service without a host:

dotnet add package Masterly.NightShift.Core
dotnet add package Masterly.NightShift.SqlServer
  • Target frameworks: net8.0, net10.0
  • Dependencies: Cronos

Example

Without a host or a DI container, configure GlobalConfiguration once at start-up and start a BackgroundJobServer yourself:

using Masterly.NightShift;

GlobalConfiguration.Configuration
    .SetDataCompatibilityLevel(CompatibilityLevel.Version_180)
    .UseSimpleAssemblyNameTypeSerializer()
    .UseRecommendedSerializerSettings()
    .UseColouredConsoleLogProvider()
    .UseSqlServerStorage(
        @"Server=(localdb)\MSSQLLocalDB;Database=NightShift;Integrated Security=True;TrustServerCertificate=True;");

BackgroundJob.Enqueue<ReportService>(x => x.BuildDaily());
RecurringJob.AddOrUpdate<ReportService>("daily-report", x => x.BuildDaily(), Cron.Daily(6));

using (var server = new BackgroundJobServer())
{
    Console.WriteLine("Server started. Press Enter to stop.");
    Console.ReadLine();
}

public class ReportService
{
    public void BuildDaily() => Console.WriteLine($"Daily report built at {DateTime.UtcNow:O}");
}

A job that throws is retried automatically, with growing delays.

Documentation

Job types, filters, the server, the dashboard and monitoring are covered in the full documentation: https://a7mdfre7at.github.io/Masterly.NightShift/. For this setup, start with Quick start: console and Worker Service.

License

MIT AND LGPL-3.0-or-later: code written for Masterly.NightShift is MIT, code derived from Hangfire stays under the LGPL. The package contains both license texts.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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 (7)

Showing the top 5 NuGet packages that depend on Masterly.NightShift.Core:

Package Downloads
Masterly.NightShift

Background jobs that work the night shift: fire-and-forget, delayed, recurring and continuation jobs for .NET, stored in SQL Server, with a dashboard. Installs the core library, SQL Server storage and the ASP.NET Core integration.

Masterly.NightShift.EntityFrameworkCore

Entity Framework Core storage for Masterly.NightShift background jobs: SQL Server, PostgreSQL, SQLite, MySQL and other relational providers. Stage jobs in your DbContext so they commit with SaveChanges.

Masterly.NightShift.InMemory

In-memory storage for Masterly.NightShift background jobs, for development and tests. No dependencies; nothing survives the process.

Masterly.NightShift.NetCore

Masterly.NightShift for the generic host: dependency injection, ILogger logging and the job server as a hosted service, for Worker Services and console apps.

Masterly.NightShift.MongoDB

MongoDB storage for Masterly.NightShift background jobs, on the official driver. Multi-document transactions on a replica set, TTL indexes for expiration.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 0 11/16/2026