NCache.Hangfire
5.3.800
dotnet add package NCache.Hangfire --version 5.3.800
NuGet\Install-Package NCache.Hangfire -Version 5.3.800
<PackageReference Include="NCache.Hangfire" Version="5.3.800" />
<PackageVersion Include="NCache.Hangfire" Version="5.3.800" />
<PackageReference Include="NCache.Hangfire" />
paket add NCache.Hangfire --version 5.3.800
#r "nuget: NCache.Hangfire, 5.3.800"
#:package NCache.Hangfire@5.3.800
#addin nuget:?package=NCache.Hangfire&version=5.3.800
#tool nuget:?package=NCache.Hangfire&version=5.3.800
NCache.Hangfire
NCache Job Storage Provider for Hangfire. This package lets you use NCache Enterprise as the backing store for Hangfire, allowing background jobs, queues, state, and execution history to be shared across multiple application instances instead of being tracked in memory or a database on individual servers. It supports durable pub/sub notifications for instant worker wake-up, automatic recovery of jobs left behind by crashed workers, and a full Hangfire Dashboard experience backed entirely by NCache.
Installation
Install-Package NCache.Hangfire
or, using the .NET CLI:
dotnet add package NCache.Hangfire
Prerequisites
- A .NET 6.0 (or later) or .NET Framework 4.6.2 (or later) application.
- The target cache must already be created, registered and running on the NCache server.
- This package depends on
Alachisoft.NCache.SDK5.3.800 andHangfire.Core. AddHangfire,AddHangfireServerandUseHangfireDashboardare provided by theHangfire.AspNetCorepackage, which your application must reference itself.
Getting Started
Connecting to the Cache
Starting with NCache SDK 5.3.800, the client no longer uses client.ncconf or tls.ncconf. The application names only the cache; the server it connects to is read from the application's own configuration file, with one entry per cache name.
.NET (appsettings.json):
{
"ncache": {
"YourCacheName": {
"server": "10.0.0.1",
"port": 9800
}
}
}
.NET Framework (App.config / Web.config):
<configuration>
<configSections>
<section name="ncache" type="Alachisoft.NCache.Client.NCacheSection, Alachisoft.NCache.Client" />
</configSections>
<ncache>
<caches>
<add name="YourCacheName" server="10.0.0.1" port="9800" />
</caches>
</ncache>
</configuration>
Replace YourCacheName with the name of your cache and 10.0.0.1 with the IP/hostname of a node hosting it. Multiple servers can be listed as a comma-separated value (for example "10.0.0.1,10.0.0.2").
Connection retries, timeouts, load balancing, client cache and TLS settings are now configured on the cache server and applied automatically when the client connects. For mutual TLS, set tlsCertPath in the same entry to the client certificate presented to the server.
Note
The
ncachesection is validated strictly: an unknown setting or an invalid port is reported as a configuration error naming the cache and the setting. Keep Hangfire settings in their own section (see Configuration) rather than insidencache.
Setting up Package
- Configure Hangfire to use NCache as its job storage:
builder.Services.AddHangfire(config =>
{
config.UseNCacheStorage("YourCacheName");
});
- Add the Hangfire server (background job processor):
builder.Services.AddHangfireServer();
- Optionally, add the Hangfire Dashboard:
app.UseHangfireDashboard();
- Enqueue and process background jobs using Hangfire's standard API:
BackgroundJob.Enqueue(() => Console.WriteLine("Hello from NCache-backed Hangfire!"));
Configuration
The storage options control how NCache.Hangfire stores and processes jobs in the cache. They are separate from the ncache connection section above.
Using appsettings.json:
{
"Hangfire": {
"NCache": {
"CacheName": "YourCacheName",
"QueuePollInterval": "00:00:10",
"InvisibilityTimeout": "00:05:00",
"DistributedLockTimeout": "00:00:30",
"EnablePubSubNotifications": true,
"DurableSubscriptionExpiry": "01:00:00",
"SucceededListSize": 10000,
"FailedListSize": 1000,
"DeletedListSize": 1000,
"TerminalListTrimInterval": "00:05:00"
}
}
}
Register the storage from configuration ("Hangfire:NCache" is the default section key):
builder.Services.AddHangfire(config =>
{
config.UseNCacheStorage(builder.Configuration);
});
Or configure programmatically:
builder.Services.AddHangfire(config =>
{
config.UseNCacheStorage(new NCacheStorageOptions
{
CacheName = "YourCacheName",
QueuePollInterval = TimeSpan.FromSeconds(10),
InvisibilityTimeout = TimeSpan.FromMinutes(5),
DistributedLockTimeout = TimeSpan.FromSeconds(30),
EnablePubSubNotifications = true,
DurableSubscriptionExpiry = TimeSpan.FromHours(1),
SucceededListSize = 10000,
FailedListSize = 1000,
DeletedListSize = 1000,
TerminalListTrimInterval = TimeSpan.FromMinutes(5)
});
});
Note
AddHangfireServer()is still required to start the background job processing.UseNCacheStorageonly configures the backing store used by Hangfire.
Resources
Technical Support
Alachisoft provides various technical support resources.
Visit the Alachisoft Support Center to select a support resource appropriate for your issue.
To request additional features or report a documentation discrepancy, contact support@alachisoft.com.
License
Copyright © 2026 Alachisoft. All rights reserved.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. 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. |
| .NET Framework | net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
.NETFramework 4.6.2
- Alachisoft.NCache.SDK (>= 5.3.800)
- Hangfire.Core (>= 1.8.25)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.0)
- System.Collections.Immutable (>= 10.0.13)
- System.Text.Json (>= 10.0.13)
-
net6.0
- Alachisoft.NCache.SDK (>= 5.3.800)
- Hangfire.Core (>= 1.8.25)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.0)
- System.Text.Json (>= 10.0.13)
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 |
|---|---|---|
| 5.3.800 | 103 | 11/4/2026 |