Quartz.HostedService 1.0.0

.NET Core 2.1
Install-Package Quartz.HostedService -Version 1.0.0
dotnet add package Quartz.HostedService --version 1.0.0
<PackageReference Include="Quartz.HostedService" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Quartz.HostedService --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Quartz.HostedService, 1.0.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Quartz.HostedService as a Cake Addin
#addin nuget:?package=Quartz.HostedService&version=1.0.0

// Install Quartz.HostedService as a Cake Tool
#tool nuget:?package=Quartz.HostedService&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.


Use .Net Core Generic Service and Quartz to Implement Background Schedule Tasks.

How to use?

Create a console application. And install the package:

PM> Install-Package Quartz.HostedService

These packages may also need:

PM> Install-Package Microsoft.Extensions.Hosting
PM> Install-Package Microsoft.Extensions.Configuration.Json
PM> Install-Package Microsoft.Extensions.Logging.Console
PM> Install-Package Microsoft.Extensions.Logging.Debug

Edit the quartz configuration in the appsettings.json:

  "Logging": {
    "LogLevel": {
      "Default": "Warning"
  "quartz": {
    "scheduler": {
      "instanceName": "Quartz.HostedService.Sample"
    "threadPool": {
      "type": "Quartz.Simpl.SimpleThreadPool, Quartz",
      "threadPriority": "Normal",
      "threadCount": 10
    "plugin": {
      "jobInitializer": {
        "type": "Quartz.Plugin.Xml.XMLSchedulingDataProcessorPlugin, Quartz.Plugins",
        "fileNames": "quartz_jobs.xml"

Write your job(s):

public class TestJob : IJob
    private readonly ILogger _logger;

    public TestJob(ILogger<TestJob> logger)
        _logger = logger;

    public Task Execute(IJobExecutionContext context)
        _logger.LogInformation(string.Format("[{0:yyyy-MM-dd hh:mm:ss:ffffff}]Test job is running...", DateTime.Now));
        return Task.CompletedTask;

Prepare the quartz_jobs.xml:

<?xml version="1.0" encoding="UTF-8"?>

<job-scheduling-data xmlns="http://quartznet.sourceforge.net/JobSchedulingData"


      <description>Test Job</description>
      <job-type>Quartz.HostedService.Sample.TestJob, Quartz.HostedService.Sample</job-type>
        <description>Test Trigger</description>


Add generic host, register quartz hosted service and job(s) in the Program.cs:

static void Main()
    var host = new HostBuilder()
        .ConfigureHostConfiguration(configHost =>
        .ConfigureAppConfiguration((hostContext, configApp) =>
            configApp.AddJsonFile("appsettings.json", true);
        .ConfigureServices((hostContext, services) =>
            services.AddSingleton<TestJob, TestJob>();
        .ConfigureLogging((hostContext, configLogging) =>


For more details about generic host please refer:

Your can also view or download the sample by

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
Compatible target framework(s)
Additional computed target framework(s)
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 21,915 7/1/2018