JGUZDV.JobHost 1.2.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package JGUZDV.JobHost --version 1.2.2
                    
NuGet\Install-Package JGUZDV.JobHost -Version 1.2.2
                    
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="JGUZDV.JobHost" Version="1.2.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="JGUZDV.JobHost" Version="1.2.2" />
                    
Directory.Packages.props
<PackageReference Include="JGUZDV.JobHost" />
                    
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 JGUZDV.JobHost --version 1.2.2
                    
#r "nuget: JGUZDV.JobHost, 1.2.2"
                    
#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 JGUZDV.JobHost@1.2.2
                    
#: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=JGUZDV.JobHost&version=1.2.2
                    
Install as a Cake Addin
#tool nuget:?package=JGUZDV.JobHost&version=1.2.2
                    
Install as a Cake Tool

JGUZDV.JobHost

JGUZDV.JobHost is a .NET package designed to simplify the creation of background jobs in a Windows service using the IHostBuilder and Quartz.net. You can easily register jobs with a cron schedule, and they will be executed in the background as part of a Windows service.

Configuration

You can configure your schedules in the appsettings.json. The default sectionName is "HostedJobs"

{
  "HostedJobs": {
    "MyJob": "* * * * * ?",
    "MyJob2": "* 0/5 * * * ?",
    "MyJob3": "false", //this prevents the job from being registered e.g. for appsettings.development.json
    "DisableDevelopmentJobSelection": "true" // optional: disables the job selestion screen and runs the jobs with the given schedule in appsettings.Development.json
  }
}

OpenTelemetry configuration

If you wish to use OpenTelemetry within your application you can define a section in your appsettings.json named "OpenTelemetry" that looks as follows: Since OpenTelemetry is added automatically within the JobHost.CreateJobHostBuilder() method through .

  ...
  "OpenTelemetry": {
    "AzureMonitor": {
      "ConnectionString": "<AzureMonitorConnectionString>"
    },
    "ServiceNamespace": "<AppNamespace>",
    "ServiceName": "<AppName>",
    "Metrics": {
      "MeterName": "<AppMeterName>",
      "MeterVersion": "<AppMeterVersion>"
    }
  },
  ...

This Example shows the full difinition of the "OpenTelemetry" section. If you wish to see a more detailed explanation, please refer to the JGUZDV.Extensions.OpenTelemetry NuGet-Package.

Usage

Your jobs must implement the IJob interface from Quartz.net. To use JGUZDV.JobHost, you can create an HostApplicationBuilder and register jobs with a cron schedule. The jobs will be executed in the background as part of a Windows service. If you wish to use metrics, you need to implement a service that inherits from JGUZDVBaseMeter and register it as a singleton, as shown in JGUZDV.Extensions.OpenTelemetry.

Here's a basic example:

using Microsoft.Extensions.DependencyInjection;
using JGUZDV.JobHost;

class Program
{
    static void Main(string[] args)
    {
        var host = JobHost.CreateJobHostBuilder(args, configureWindowsService, quartzHostedServiceOptions)
            .AddHostedJob<MyJob>() // with the configuration above the job runs every second
            .AddHostedJob<MyJob2>() // with the configuration above the job runs every 5 minutes (at 0, 5, 10, 15.... etc Minutes)
            
        host.Services.AddSingleton<MeterContainer>(); // as shown in the JGUZDV.Extensions.OpenTelemetry example
            
        var app = host.Build();

        _ = app.RunAsync();
    }
}
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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 was computed.  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 (1)

Showing the top 1 NuGet packages that depend on JGUZDV.JobHost:

Package Downloads
JGUZDV.JobHost.Dashboard.EntityFrameworkCore

Database of Dashboard for JGUZDV.JobHost package.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.7.1 46 11/12/2026
1.7.0 48 11/12/2026 1.7.0 is deprecated because it is no longer maintained and has critical bugs.
1.6.0 106 11/5/2026
1.5.0 99 11/5/2026
1.4.0 109 11/3/2026
1.3.1 106 11/3/2026
1.3.0 214 2/2/2026
1.2.4 241 10/8/2025
1.2.2 283 4/9/2025
1.2.1 239 3/31/2025
1.2.0 238 3/31/2025
1.1.12 556 3/26/2025
1.1.11 273 4/18/2024
1.0.3 213 4/16/2024
1.0.2 258 2/7/2024
1.0.1 209 2/6/2024
1.0.0 213 2/1/2024