JGUZDV.JobHost
1.7.1
dotnet add package JGUZDV.JobHost --version 1.7.1
NuGet\Install-Package JGUZDV.JobHost -Version 1.7.1
<PackageReference Include="JGUZDV.JobHost" Version="1.7.1" />
<PackageVersion Include="JGUZDV.JobHost" Version="1.7.1" />
<PackageReference Include="JGUZDV.JobHost" />
paket add JGUZDV.JobHost --version 1.7.1
#r "nuget: JGUZDV.JobHost, 1.7.1"
#:package JGUZDV.JobHost@1.7.1
#addin nuget:?package=JGUZDV.JobHost&version=1.7.1
#tool nuget:?package=JGUZDV.JobHost&version=1.7.1
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 | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- JGUZDV.Extensions.Logging (>= 2.0.1)
- JGUZDV.Extensions.OpenTelemetry (>= 2.1.0)
- JGUZDV.JobHost.Shared (>= 1.7.1)
- Microsoft.Extensions.Hosting (>= 10.0.15)
- Microsoft.Extensions.Hosting.WindowsServices (>= 10.0.15)
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 | 6 | 11/12/2026 | |
| 1.7.0 | 6 | 11/12/2026 | |
| 1.6.0 | 105 | 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 |