Quartz.NET job scheduler - cron, calendar and interval triggers, clustering over a persistent job store, and Microsoft.Extensions hosting, logging, options and dependency injection throughout. The core package: everything else builds on this one.
Get Started
| Product | Versions |
|---|---|
| .NET |
README
Quartz.NET
Quartz.NET is a full-featured, open source job scheduling system that can be used from the smallest apps to large scale enterprise systems.
Installation
dotnet add package Quartz
That is everything a scheduler needs: dependency injection, hosting, the scheduler health check and System.Text.Json serialization are part of this package, where Quartz 3 shipped them separately.
The package carries a net10.0 assembly and a net11.0 one compiled with runtime async, where the .NET 11
runtime suspends and resumes Quartz's async methods without compiler state machines. Both have the same API,
and NuGet picks the one your application targets.
Three things Quartz deliberately does not bring. The host below is Microsoft's — a project that has no
Microsoft.Extensions.Hosting reference yet (a plain console one; the worker and web templates
already have it) adds dotnet add package Microsoft.Extensions.Hosting. Quartz writes log events and
leaves deciding where they go to the application, so it references
Microsoft.Extensions.Logging.Abstractions rather than Microsoft.Extensions.Logging — a host brings
the implementation with it, and a project that builds an ILoggerFactory itself adds
dotnet add package Microsoft.Extensions.Logging. And a persistent store loads its ADO.NET driver by
name, so UseSqlServer needs Microsoft.Data.SqlClient referenced, UsePostgres needs Npgsql, and
so on.
Quick start
A job is a class with one method:
public sealed class HelloJob : IJob
{
public async ValueTask Execute(IJobExecutionContext context, CancellationToken cancellationToken = default)
{
await Console.Out.WriteLineAsync("Greetings from HelloJob!");
}
}
Register it with a trigger that fires it; the hosted service starts and stops the scheduler with the application:
HostApplicationBuilder builder = Host.CreateApplicationBuilder(args);
builder.AddQuartz(q => q.ScheduleJob<HelloJob>(trigger => trigger
.WithIdentity("hello")
.WithSimpleSchedule(TimeSpan.FromSeconds(10))));
builder.AddQuartzHostedService(options => options.WaitForJobsToComplete = true);
A recurring job can instead be declared on its class with [QuartzJob] and [CronTrigger("0 0 0/6 * * ?")];
a source generator in this package writes the registration, and an analyzer fails the build on a cron
expression that would not parse. See
Declaring jobs with attributes.
Console applications and tests build a scheduler without a host, from the same configuration API:
IScheduler scheduler = await QuartzSchedulerBuilder.Create().BuildScheduler();
await scheduler.Start();
Optional packages
| Package | For |
|---|---|
| Quartz.AspNetCore | the HTTP API |
| Quartz.Aspire | a persistent store, its telemetry and its health check from an Aspire connection name |
| Quartz.Dashboard | the web dashboard |
| Quartz.Dashboard.Agent | putting a scheduler on a dashboard elsewhere, over one outbound connection |
| Quartz.HttpClient | driving a remote scheduler over the HTTP API |
| Quartz.Jobs | ready-made jobs: file scanning, sending mail, running a process |
| Quartz.Plugins | history logging, XML and JSON schedule files |
| Quartz.Plugins.TimeZoneConverter | Windows and IANA time zone ids resolving on either operating system |
| Quartz.Serialization.Newtonsoft | persisting with Newtonsoft.Json instead of System.Text.Json |
| Quartz.Weasel.* | the store's tables under Weasel, as Marten and Wolverine manage theirs; one package per database |
| Quartz.Extensions.Redis | Redis distributed locks for a cluster |
Documentation
Downloads by Version
Similar & Alternative Packages
Hand-picked matching NuGet libraries based on tags & ecosystem
Depended On By
Find packages that declare this package as a dependency. NuGet does not provide a reverse-dependency endpoint, so candidates are checked on demand.
Adoption Assessment
A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.