A Quartz.NET job is a background task whose executable logic is defined by a class implementing IJob. The job contains the work to perform; Quartz.NET schedules and runs it in the background. section 34.3 section 34.3.1
A workflow job works with several Quartz.NET components:
- The job implementation defines the task logic. section 34.3.1
- Triggers determine when the job runs, such as every five minutes or on a monthly schedule. section 34.3
- The job factory creates job instances, using the dependency-injection container when configured. section 34.3 section 34.3.1
- The Quartz.NET hosted service starts the scheduler with the application and can wait for running jobs to finish during shutdown. section 34.3.1
A worker-service job setup
Install Quartz.Extensions.Hosting, register Quartz.NET with the Microsoft dependency-injection job factory, and add its hosted service. The scheduler then starts with the application; without registered jobs and triggers, it has nothing to schedule. section 34.3.1
Listing 34.10 Configuring Quartz.NET
using Quartz;
IHost host = Host.CreateDefaultBuilder(args)
.ConfigureServices((hostContext, services) => #1
{
services.AddQuartz(q => #2
{
q. UseMicrosoftDependencyInjectionJobFactory(); #3
});
services.AddQuartzHostedService( #4
q => q.WaitForJobsToComplete = true); #4
})
.Build();
host.Run();
Shows the minimal host configuration that registers Quartz.NET and starts its scheduler as a hosted service. section 34.3.1
When multiple application instances must share jobs, Quartz.NET can persist its configuration in a database and use clustering so only one instance handles a trigger at a time. section 34.3.3

