NCache.Hangfire 5.3.800

dotnet add package NCache.Hangfire --version 5.3.800
                    
NuGet\Install-Package NCache.Hangfire -Version 5.3.800
                    
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.
<PackageReference Include="NCache.Hangfire" Version="5.3.800" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NCache.Hangfire" Version="5.3.800" />
                    
Directory.Packages.props
<PackageReference Include="NCache.Hangfire" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NCache.Hangfire --version 5.3.800
                    
#r "nuget: NCache.Hangfire, 5.3.800"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package NCache.Hangfire@5.3.800
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NCache.Hangfire&version=5.3.800
                    
Install as a Cake Addin
#tool nuget:?package=NCache.Hangfire&version=5.3.800
                    
Install as a Cake Tool

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.SDK 5.3.800 and Hangfire.Core.
  • AddHangfire, AddHangfireServer and UseHangfireDashboard are provided by the Hangfire.AspNetCore package, 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 ncache section 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 inside ncache.

Setting up Package

  1. Configure Hangfire to use NCache as its job storage:
builder.Services.AddHangfire(config =>
{
    config.UseNCacheStorage("YourCacheName");
});
  1. Add the Hangfire server (background job processor):
builder.Services.AddHangfireServer();
  1. Optionally, add the Hangfire Dashboard:
app.UseHangfireDashboard();
  1. 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. UseNCacheStorage only 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
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
5.3.800 103 11/4/2026