Quartz.Extensions.Hosting 1.0.0

Runs Quartz.net as a HostedService in a generic host.

Install-Package Quartz.Extensions.Hosting -Version 1.0.0
dotnet add package Quartz.Extensions.Hosting --version 1.0.0
<PackageReference Include="Quartz.Extensions.Hosting" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Quartz.Extensions.Hosting --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Quartz Hosting

Do you want to write services the dotnet core way, using the IHostedService interface? Is Quartz server too much for your current need? Then use this extension to run your applicaton with quartz.

Install

Quartz.Extensions.Hosting is available as a Nuget-package. From the Package Manager Console enter:

    Install-Package Quartz.Extensions.Hosting

How to use in a console application

Build a generic host the normal way. Use the HostBuilder class as you normally do when building a console app. Then add in quartz and any scheduler configuration.

    var builder = new HostBuilder()
        .ConfigureServices((hostContext, services) =>
        {
            services.AddQuartz(scheduler => 
            {
                scheduler.ScheduleJob(
                    JobBuilder
                        .Create(typeof(HelloJob))
                        .Build(),
                    TriggerBuilder
                        .Create()
                        .WithSimpleSchedule(s => s
                            .WithIntervalInSeconds(5)
                            .RepeatForever())
                        .Build());
            });
        });

How to use in an MVC application

In Startup.cs, use the extension method in ConfigureServices. Order is not important with registration.

    public void ConfigureServices(IServiceCollection services)
    {
        services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
        services.AddQuartz(scheduler =>
        {
            scheduler.ScheduleJob(
                JobBuilder
                    .Create(typeof(HelloJob))
                    .Build(),
                TriggerBuilder
                    .Create()
                    .WithSimpleSchedule(s => s
                        .WithIntervalInSeconds(5)
                        .RepeatForever())
                    .Build());
        });
    }

Quartz Hosting

Do you want to write services the dotnet core way, using the IHostedService interface? Is Quartz server too much for your current need? Then use this extension to run your applicaton with quartz.

Install

Quartz.Extensions.Hosting is available as a Nuget-package. From the Package Manager Console enter:

    Install-Package Quartz.Extensions.Hosting

How to use in a console application

Build a generic host the normal way. Use the HostBuilder class as you normally do when building a console app. Then add in quartz and any scheduler configuration.

    var builder = new HostBuilder()
        .ConfigureServices((hostContext, services) =>
        {
            services.AddQuartz(scheduler => 
            {
                scheduler.ScheduleJob(
                    JobBuilder
                        .Create(typeof(HelloJob))
                        .Build(),
                    TriggerBuilder
                        .Create()
                        .WithSimpleSchedule(s => s
                            .WithIntervalInSeconds(5)
                            .RepeatForever())
                        .Build());
            });
        });

How to use in an MVC application

In Startup.cs, use the extension method in ConfigureServices. Order is not important with registration.

    public void ConfigureServices(IServiceCollection services)
    {
        services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
        services.AddQuartz(scheduler =>
        {
            scheduler.ScheduleJob(
                JobBuilder
                    .Create(typeof(HelloJob))
                    .Build(),
                TriggerBuilder
                    .Create()
                    .WithSimpleSchedule(s => s
                        .WithIntervalInSeconds(5)
                        .RepeatForever())
                    .Build());
        });
    }

Release Notes

Targets netstandard2.2

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on Quartz.Extensions.Hosting:

Repository Stars
openiddict/openiddict-core
Versatile OpenID Connect stack for ASP.NET Core 2.1/3.1/5.0 and OWIN/Katana 4.1 (compatible with ASP.NET 4.6.1)

Version History

Version Downloads Last updated
1.0.0 611 5/30/2019