Quartz.Extensions.DependencyInjection 3.11.0

Prefix Reserved
dotnet add package Quartz.Extensions.DependencyInjection --version 3.11.0                
NuGet\Install-Package Quartz.Extensions.DependencyInjection -Version 3.11.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="Quartz.Extensions.DependencyInjection" Version="3.11.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Quartz.Extensions.DependencyInjection --version 3.11.0                
#r "nuget: Quartz.Extensions.DependencyInjection, 3.11.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.
// Install Quartz.Extensions.DependencyInjection as a Cake Addin
#addin nuget:?package=Quartz.Extensions.DependencyInjection&version=3.11.0

// Install Quartz.Extensions.DependencyInjection as a Cake Tool
#tool nuget:?package=Quartz.Extensions.DependencyInjection&version=3.11.0                

Quartz.Extensions.DependencyInjection provides integration with Microsoft Dependency Injection.

::: tip Quartz 3.1 or later required. :::


You need to add NuGet package reference to your project which uses Quartz.

Install-Package Quartz.Extensions.DependencyInjection


You can add Quartz configuration by invoking an extension method AddQuartz on IServiceCollection. The configuration building wraps various configuration properties with strongly-typed API. You can also configure properties using standard .NET Core appsettings.json inside configuration section Quartz.

::: tip Quartz.Extensions.Hosting allows you to have a background service for your application that handles starting and stopping the scheduler. :::

Example appsettings.json

  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft": "Warning",
      "Microsoft.Hosting.Lifetime": "Information"
  "Quartz": {
    "quartz.scheduler.instanceName": "Quartz ASP.NET Core Sample Scheduler"

DI aware job factories

Quartz comes with two built-in alternatives for job factory which can be configured via either calling UseMicrosoftDependencyInjectionJobFactory or UseMicrosoftDependencyInjectionScopedJobFactory (deprecated).

::: tip As of Quartz.NET 3.7 all jobs are created as scoped and MS DI is configured by default. There shouldn't be need to call UseMicrosoftDependencyInjection* overloads. :::

Job instance construction

By default Quartz will try to resolve job's type from container and if there's no explicit registration Quartz will use ActivatorUtilities to construct job and inject it's dependencies via constructor. Job should have only one public constructor.

Persistent job stores

The scheduling configuration will be checked against database and updated accordingly every time your application starts and schedule is being evaluated.

::: warning When using persistent job store, make sure you define job and trigger names for your scheduling so that existence checks work correctly against the data you already have in your database.

Using API to configure triggers and jobs without explicit job identity configuration will cause jobs and triggers to have different generated name each time configuration is being evaluated.

With persistent job stores it's best practice to always declare at least job and trigger name. Omitting the group for them will produce same default group value for every invocation. :::

Example Startup.ConfigureServices configuration

public void ConfigureServices(IServiceCollection services)
    // base configuration from appsettings.json

    // if you are using persistent job store, you might want to alter some options
    services.Configure<QuartzOptions>(options =>
        options.Scheduling.IgnoreDuplicates = true; // default: false
        options.Scheduling.OverWriteExistingData = true; // default: true

    services.AddQuartz(q =>
        // handy when part of cluster or you want to otherwise identify multiple schedulers
        q.SchedulerId = "Scheduler-Core";
        // we take this from appsettings.json, just show it's possible
        // q.SchedulerName = "Quartz ASP.NET Core Sample Scheduler";
        // or for scoped service support like EF Core DbContext
        // q.UseMicrosoftDependencyInjectionScopedJobFactory();
        // these are the defaults
        q.UseDefaultThreadPool(tp =>
            tp.MaxConcurrency = 10;

        // quickest way to create a job with single trigger is to use ScheduleJob
        // (requires version 3.2)
        q.ScheduleJob<ExampleJob>(trigger => trigger
            .WithIdentity("Combined Configuration Trigger")
            .WithDailyTimeIntervalSchedule(x => x.WithInterval(10, IntervalUnit.Second))
            .WithDescription("my awesome trigger configured for a job with single call")

        // you can also configure individual jobs and triggers with code
        // this allows you to associated multiple triggers with same job
        // (if you want to have different job data map per trigger for example)
        q.AddJob<ExampleJob>(j => j
            .StoreDurably() // we need to store durably if no trigger is associated
            .WithDescription("my awesome job")

        // here's a known job for triggers
        var jobKey = new JobKey("awesome job", "awesome group");
        q.AddJob<ExampleJob>(jobKey, j => j
            .WithDescription("my awesome job")

        q.AddTrigger(t => t
            .WithIdentity("Simple Trigger")    
            .WithSimpleSchedule(x => x.WithInterval(TimeSpan.FromSeconds(10)).RepeatForever())
            .WithDescription("my awesome simple trigger")

        q.AddTrigger(t => t
            .WithIdentity("Cron Trigger")    
            .WithCronSchedule("0/3 * * * * ?")
            .WithDescription("my awesome cron trigger")

        // you can add calendars too (requires version 3.2)
        const string calendarName = "myHolidayCalendar";
            name: calendarName,
            replace: true,
            updateTriggers: true,
            x => x.AddExcludedDate(new DateTime(2020, 5, 15))

        q.AddTrigger(t => t
            .WithIdentity("Daily Trigger")
            .WithDailyTimeIntervalSchedule(x => x.WithInterval(10, IntervalUnit.Second))
            .WithDescription("my awesome daily time interval trigger")
        // also add XML configuration and poll it for changes
        q.UseXmlSchedulingConfiguration(x =>
            x.Files = new[] { "~/quartz_jobs.config" };
            x.ScanInterval = TimeSpan.FromSeconds(2);
            x.FailOnFileNotFound = true;
            x.FailOnSchedulingError = true;

        // convert time zones using converter that can handle Windows/Linux differences
        // auto-interrupt long-running job
        q.UseJobAutoInterrupt(options =>
            // this is the default
            options.DefaultMaxRunTime = TimeSpan.FromMinutes(5);
            triggerConfigurator => triggerConfigurator
                .WithSimpleSchedule(x => x.WithIntervalInSeconds(5).RepeatForever()),
            jobConfigurator => jobConfigurator
                .UsingJobData(JobInterruptMonitorPlugin.JobDataMapKeyAutoInterruptable, true)
                // allow only five seconds for this job, overriding default configuration
                .UsingJobData(JobInterruptMonitorPlugin.JobDataMapKeyMaxRunTime, TimeSpan.FromSeconds(5).TotalMilliseconds.ToString(CultureInfo.InvariantCulture)));

        // add some listeners

        // example of persistent job store using JSON serializer as an example
        q.UsePersistentStore(s =>
            s.PerformSchemaValidation = true; // default
            s.UseProperties = true; // preferred, but not default
            s.RetryInterval = TimeSpan.FromSeconds(15);
            s.UseSqlServer(sqlServer =>
                sqlServer.ConnectionString = "some connection string";
                // this is the default
                sqlServer.TablePrefix = "QRTZ_";
            s.UseClustering(c =>
                c.CheckinMisfireThreshold = TimeSpan.FromSeconds(20);
                c.CheckinInterval = TimeSpan.FromSeconds(10);
	// we can use options pattern to support hooking your own configuration
	// because we don't use service registration api, 
	// we need to manually ensure the job is present in DI
		.Configure<IOptions<SampleOptions>>((options, dep) =>
			if (!string.IsNullOrWhiteSpace(dep.Value.CronSchedule))
				var jobKey = new JobKey("options-custom-job", "custom");
				options.AddJob<ExampleJob>(j => j.WithIdentity(jobKey));
				options.AddTrigger(trigger => trigger
					.WithIdentity("options-custom-trigger", "custom")
    // Quartz.Extensions.Hosting allows you to fire background service that handles scheduler lifecycle
    services.AddQuartzHostedService(options =>
        // when shutting down we want jobs to complete gracefully
        options.WaitForJobsToComplete = true;
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 is compatible. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (70)

Showing the top 5 NuGet packages that depend on Quartz.Extensions.DependencyInjection:

Package Downloads

Quartz.NET Generic Host integration; Quartz Scheduling Framework for .NET


Quartz.NET integration package for OpenIddict.


Elsa is a set of workflow libraries and tools that enable lean and mean workflowing capabilities in any .NET Core application. This package provides a Quartz timer provider.


Package Description


Package Description

GitHub repositories (8)

Showing the top 5 popular GitHub repositories that depend on Quartz.Extensions.DependencyInjection:

Repository Stars
Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
A .NET workflows library
Flexible and versatile OAuth 2.0/OpenID Connect stack for .NET
🚀 Mixcore CMS is an Future-Proof Enterprise Web CMS that supports both headless and decoupled to easily build any kinds of app/web app/all in all/customizable APIs built on top of ASP.NET Core / Dotnet Core. It is a completely open-source ASP.NET Core (Dotnet Core) CMS solution. https://mixcore.org
Version Downloads Last updated
3.11.0 31,660 7/7/2024
3.10.0 85,079 6/26/2024
3.9.0 590,544 5/9/2024
3.8.1 1,343,982 2/17/2024
3.8.0 1,759,691 11/18/2023
3.7.0 1,936,621 8/4/2023
3.6.3 762,164 6/25/2023
3.6.2 2,846,483 2/25/2023
3.6.1 4,140 2/25/2023
3.6.0 656,889 1/29/2023
3.5.0 3,208,874 9/18/2022
3.4.0 3,737,976 3/27/2022
3.3.3 4,308,437 8/1/2021
3.3.2 1,119,494 4/9/2021
3.3.1 44,102 4/8/2021
3.3.0 15,683 4/7/2021
3.2.4 1,659,251 1/19/2021
3.2.3 687,196 10/31/2020
3.2.2 46,710 10/19/2020
3.2.1 10,842 10/18/2020
3.2.0 31,114 10/2/2020
3.1.0 258,653 7/24/2020
0.4.0 3,858 4/27/2020
0.3.0 1,689 3/25/2020
0.2.0 1,318 2/17/2020
0.1.1 2,993 11/15/2018
0.1.0 3,343 11/14/2018