Hangfire.Stashbox 1.0.2

.NET Standard 1.3 .NET Framework 4.5
There is a newer version of this package available.
See the version list below for details.
NuGet\Install-Package Hangfire.Stashbox -Version 1.0.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.
dotnet add package Hangfire.Stashbox --version 1.0.2
<PackageReference Include="Hangfire.Stashbox" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Hangfire.Stashbox --version 1.0.2
#r "nuget: Hangfire.Stashbox, 1.0.2"
#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 Hangfire.Stashbox as a Cake Addin
#addin nuget:?package=Hangfire.Stashbox&version=1.0.2

// Install Hangfire.Stashbox as a Cake Tool
#tool nuget:?package=Hangfire.Stashbox&version=1.0.2

stashbox-hangfire

Appveyor build status Travis CI build status NuGet Version

This project provides Stashbox integration for Hangfire, using Stashbox container and Scopes to resolve jobs and their dependencies.

Common usage

To integrate Stashbox as the default JobActivator into Hangfire, you can use the UseStashboxActivator extension method on the IGlobalConfiguration interface.

var container = new StashboxContainer();

GlobalConfiguration.Configuration.UseStashboxActivator(container);

ASP.NET Core

As the ASP.NET Core extension of Hangfire uses the configured IServiceProvider to resolve jobs through an AspNetCoreJobActivator, so for using Stashbox as the default job activator you can simply just use the ASP.NET Core integration of Stashbox which will replace the default IServiceProvider with a Stashbox container.

However you also have the option to tell Hangfire that it should use the StashboxJobActivator directly.

public IServiceProvider ConfigureService(IServiceCollection services)
{
    services.AddHangfire((provider, config) => 
        config.UseStashboxActivator(provider.GetService<IDependencyResolver>()));

    return services.UseStashbox();
}

.NET Generic Host

using (var host = new HostBuilder()
    .UseStashbox()
    .ConfigureContainer<IStashboxContainer>((context, container) =>
    {
        container.Register<JobActivator, StashboxJobActivator>();
    })
    .ConfigureServices((context, services) =>
    {
        services.AddHangfireServer();
    })
    .Build())
{
    // start and use your host
}
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 netcoreapp1.0 netcoreapp1.1 netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard1.3 netstandard1.4 netstandard1.5 netstandard1.6 netstandard2.0 netstandard2.1
.NET Framework net45 net451 net452 net46 net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen30 tizen40 tizen60
Universal Windows Platform uap uap10.0
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
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
4.2.3 64 9/9/2022
4.2.2 109 6/2/2022
4.2.1 96 5/17/2022
4.2.0 96 5/3/2022
4.1.1 117 3/12/2022
4.1.0 90 3/7/2022
4.0.1 107 2/10/2022
4.0.0 102 2/9/2022
3.1.0 282 11/22/2021
3.0.3 166 5/26/2021
3.0.2 202 3/16/2021
3.0.1 339 11/15/2020
3.0.0 304 10/19/2020
1.2.2 296 6/8/2020
1.2.1 288 6/8/2020
1.2.0 259 6/8/2020
1.1.0 382 9/11/2019
1.0.2 364 5/9/2019