![]() |
VOOZH | about |
dotnet add package Autofac.Extras.Quartz --version 11.0.0
NuGet\Install-Package Autofac.Extras.Quartz -Version 11.0.0
<PackageReference Include="Autofac.Extras.Quartz" Version="11.0.0" />
<PackageVersion Include="Autofac.Extras.Quartz" Version="11.0.0" />Directory.Packages.props
<PackageReference Include="Autofac.Extras.Quartz" />Project file
paket add Autofac.Extras.Quartz --version 11.0.0
#r "nuget: Autofac.Extras.Quartz, 11.0.0"
#:package Autofac.Extras.Quartz@11.0.0
#addin nuget:?package=Autofac.Extras.Quartz&version=11.0.0Install as a Cake Addin
#tool nuget:?package=Autofac.Extras.Quartz&version=11.0.0Install as a Cake Tool
Autofac integration package for Quartz.Net.
Autofac.Extras.Quartz creates nested litefime scope for each Quartz Job. Nested scope is disposed after job execution has been completed.
This allows to have single instance per job execution as well as deterministic disposal of resources.
Install package: dotnet add package Autofac.Extras.Quartz
| Stable | Pre-release | |
|---|---|---|
| Build | π Master branch |
π Development branch |
| NuGet | π NuGet |
π NuGet |
| CodeCov | π codecov |
π codecov |
Autofac configuration for Quartz includes two steps:
QuartzAutofacFactoryModule registers custom ISchedulerFactory and default instance of IScheduler in Autofac container.
Both factory and schedulere are registered as singletones.
Note: Is is important to resolve IScheduler from container, rather than using default one to get jobs resolved by Autofac.
Optionally custom Quartz configuration can be passed using ConfigurationProvider property. Provider is callback which returns settings using NameValueCollection.
Starting with version 7 QuartzAutofacFactoryModule provides a way to customize lifetime scope configuration for job. This can be done via JobScopeConfigurator parameter.
cb.Register(_ => new ScopedDependency("global"))
.AsImplementedInterfaces()
.SingleInstance();
cb.RegisterModule(new QuartzAutofacFactoryModule {
JobScopeConfigurator = (builder, jobScopeTag) => {
// override dependency for job scope
builder.Register(_ => new ScopedDependency("job-local "+ DateTime.UtcNow.ToLongTimeString()))
.AsImplementedInterfaces()
.InstancePerMatchingLifetimeScope(jobScopeTag);
}
});
See for details.
QuartzAutofacJobsModule scans given assemblies and registers all non-abstract implementors of IJob interface as transient instances.
internal static ContainerBuilder ConfigureContainer(ContainerBuilder cb)
{
// 1) Register IScheduler
cb.RegisterModule(new QuartzAutofacFactoryModule());
// 2) Register jobs
cb.RegisterModule(new QuartzAutofacJobsModule(typeof (CleanupExpiredAnnouncemetsJob).Assembly));
}
Make sure to start the scheduler after it was resolved from Autofac. E.g.
var scheduler = _container.Resolve<IScheduler>();
scheduler.Start();
TopShelf-based sample was removed since Topshelf.Quartz is not compatible with Quartz 3 as af now.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 is compatible. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on Autofac.Extras.Quartz:
| Package | Downloads |
|---|---|
|
Lauener.Core.Triggers
A easy to use Quartz implementation |
|
|
HwApp.Quartz
HwApp Quartz & Quartzmin |
|
|
SyWaterStandardLibrary
θη¦Ήζ‘ζΆCore 3.0 |
|
|
Cogito.Quartz.Autofac
Provides utilites and extensions for Quartz and Autofac. |
|
|
Sintek.Schedule
Compact Quartz.net based library for quick integration of task scheduling into you app. |
Showing the top 1 popular GitHub repositories that depend on Autofac.Extras.Quartz:
| Repository | Stars |
|---|---|
|
Reaparr/Reaparr
Plex downloader that brings content from any server to yours!
|
| Version | Downloads | Last Updated |
|---|---|---|
| 11.1.0-alpha0002 | 133 | 3/5/2026 |
| 11.0.0 | 22,885 | 3/5/2026 |
| 10.1.0-alpha0007 | 359 | 2/10/2026 |
| 10.0.0 | 663,480 | 3/7/2024 |
| 10.0.0-alpha0007 | 266 | 3/5/2024 |
| 10.0.0-alpha0006 | 275 | 3/4/2024 |
| 9.0.0 | 270,077 | 3/27/2023 |
| 8.2.0 | 83,703 | 1/30/2023 |
| 8.2.0-alpha0001 | 373 | 1/30/2023 |
| 8.1.0 | 3,163 | 1/24/2023 |
| 8.1.0-alpha0003 | 399 | 12/22/2022 |
| 8.1.0-alpha0002 | 386 | 12/22/2022 |
| 8.0.0 | 164,313 | 6/3/2022 |
| 7.4.0-alpha0007 | 460 | 6/2/2022 |
| 7.4.0-alpha0005 | 11,199 | 5/17/2022 |
| 7.4.0-alpha0002 | 416 | 5/8/2022 |
| 7.3.0 | 205,197 | 10/28/2021 |
| 7.3.0-alpha0009 | 508 | 10/28/2021 |