Alachisoft.NCache.SDK 5.3.7

There is a newer version of this package available.
See the version list below for details.
dotnet add package Alachisoft.NCache.SDK --version 5.3.7
                    
NuGet\Install-Package Alachisoft.NCache.SDK -Version 5.3.7
                    
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="Alachisoft.NCache.SDK" Version="5.3.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Alachisoft.NCache.SDK" Version="5.3.7" />
                    
Directory.Packages.props
<PackageReference Include="Alachisoft.NCache.SDK" />
                    
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 Alachisoft.NCache.SDK --version 5.3.7
                    
#r "nuget: Alachisoft.NCache.SDK, 5.3.7"
                    
#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 Alachisoft.NCache.SDK@5.3.7
                    
#: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=Alachisoft.NCache.SDK&version=5.3.7
                    
Install as a Cake Addin
#tool nuget:?package=Alachisoft.NCache.SDK&version=5.3.7
                    
Install as a Cake Tool

Alachisoft.NCache.SDK

This NCache SDK NuGet package explains the complete package avaialble for using NCache with .NET. Essentially, it provides the client APIs required to build .NET applications with NCache.

Package Versions

Package Version
Alachisoft.NCache.SDK Enterprise Edition

Overview

The NCache SDK includes client libraries for the following:

  • CacheManager — Provides static methods for establishing connections to an NCache cache.
  • ICache — Represents a cache instance and exposes APIs for CRUD operations, querying, messaging, events, locking, expiration, and other cache operations.
  • CacheConnectionOptions — Configures how client applications connect to the cache, including server endpoints, security, retry behavior, timeouts, and other connection settings.
  • CacheItem — Represents a cache entry together with metadata such as expiration, priority, groups, tags, named tags, and dependencies.
  • Supporting APIs — Includes types for SQL queries, Continuous Queries, Pub/Sub messaging, client cache, cache dependencies, serialization, security, runtime events, and other distributed caching features.

Applications establish a connection by calling CacheManager.GetCache(), which returns an ICache instance. Once connected, the ICache interface provides access to all supported NCache operations, including storing and retrieving data, executing queries, publishing messages, receiving notifications, and managing cache entries. Several of the features are highlighted below.

Key Features

What Is Installed

Installing the Alachisoft.NCache.SDK package adds the NCache assemblies and configuration files required by a .NET application to connect to and use an NCache cache.

The following configuration files are copied to the application's output directory:

File Description
client.ncconf Contains cache server and client connectivity information.
config.ncconf Contains configuration for local InProc caches and InProc client caches. For a client cache, it also identifies the associated clustered cache.
tls.ncconf Contains TLS and certificate settings for securing NCache communication, including mutual TLS configuration.

NCache first looks for these files in the application's local directory. If the required configuration is not available locally, it attempts to read it from the NCache installation directory. When NCache is not installed on the application machine, ensure that the local configuration files contain all required cache and connection information.

Prerequisites

Before using this package, ensure you have:

  1. Existing Cache: A running cluster (e.g., demoCache) must already be created on an NCache server.
  2. .NET Version: The recommended target framework is .NET 10.0. For all supported .NET versions, refer to Supported .NET Versions.
  3. NCache Installation: You must have NCache Enterprise installed on your cache servers. For the client machine, you only need the client libraries.
  4. Cache Connectivity: Ensure network access to the cache servers.

Installation

Install the Alachisoft.NCache.SDK package using either the NuGet Package Manager Console or the .NET CLI.

NuGet Package Manager Console

Install-Package Alachisoft.NCache.SDK

.NET CLI

dotnet add package Alachisoft.NCache.SDK

Connect to Cache

Use CacheManager.GetCache() to connect to an existing NCache cache. The method returns an ICache instance, which is used to perform cache operations.

using Alachisoft.NCache.Client;

ICache cache = CacheManager.GetCache("demoCache");

You can also provide connection settings programmatically by using CacheConnectionOptions.

var connectionOptions = new CacheConnectionOptions
{
    ServerList = new List<ServerInfo>
    {
        new ServerInfo("127.0.0.1")
    }
};

ICache cache = CacheManager.GetCache("demoCache", connectionOptions);

CacheConnectionOptions controls how the client application connects to NCache.

**Property ** Description
ServerList List of NCache server nodes used to establish the cache connection.
ClientRequestTimeOut Maximum time the client waits for a response from the cache server.
ConnectionTimeout Maximum time allowed for establishing a connection with a cache server.
CommandRetries Number of times a failed command is retried.
RetryInterval Time interval between connection retries.
UserCredentials Credentials used to connect to a secured cache.

Connection information can also be provided through the local client.ncconf file.

Usage

After obtaining an ICache instance, use it to add, retrieve, update, and remove cached data.

using Alachisoft.NCache.Client;
using Alachisoft.NCache.Runtime.Caching;

ICache cache = CacheManager.GetCache("demoCache");

var customer = new Customer
{
    CustomerId = "ALFKI",
    Name = "Alfreds Futterkiste"
};

string key = $"Customer:{customer.CustomerId}";

// Add data to the cache
cache.Add(key, customer);

// Retrieve data from the cache
Customer cachedCustomer = cache.Get<Customer>(key);

// Update data in the cache
customer.Name = "Updated Customer Name";
cache.Insert(key, customer);

// Remove data from the cache
cache.Remove(key);

Once connected:

  • Cache operations are performed through the ICache interface.
  • Expiration, dependencies, tags, locking, and other metadata can be configured through CacheItem.
  • Search, messaging, events, and other NCache features are available through their respective APIs.

Validation

When CacheManager.GetCache() is called, NCache validates the cache name and the supplied connection settings before establishing a cache connection.

The following conditions should be met:

  • The cache name must be specified.
  • The specified cache must already exist and be running.
  • CacheConnectionOptions, when provided, must contain valid connection settings.
  • Each entry in ServerList must specify a valid NCache server address.
  • The client machine must be able to communicate with the cache servers.
  • Valid credentials must be provided when connecting to a secured cache.

If the cache does not exist, cannot be reached, or the supplied connection information is invalid, NCache throws an exception while establishing the connection.

Best Practices

  • Reuse the ICache instance throughout the application instead of creating a new connection for every operation.
  • Configure multiple cache server addresses in ServerList for distributed deployments.
  • Use appropriate expiration policies to prevent unused data from remaining in the cache.
  • Avoid caching excessively large objects.
  • Use asynchronous and bulk operations where appropriate.
  • Use separate cache configurations for development, testing, and production environments.
  • Secure production cache communication using TLS and authentication.
  • Dispose of the cache connection when the application shuts down.

Resources

Technical Support

Alachisoft provides various technical support resources.

Copyrights

Copyright © 2026 Alachisoft. All rights reserved.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net40 is compatible.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (21)

Showing the top 5 NuGet packages that depend on Alachisoft.NCache.SDK:

Package Downloads
EntityFrameworkCore.NCache

Entity Framework Core for NCache lets you use NCache as a cache for Entity Framework Core using extension methods. NCache is an extremely fast and scalable in-memory distributed cache that removes performance bottlenecks related to data storage and databases.

NCache.Microsoft.Extensions.Caching

Distributed cache implementation of Microsoft.Extensions.Caching.Distributed.IDistributedCache using NCache Enterprise. This implementation of IDistributedCache can also be used for caching ASP.NET Core response.

AspNet.SessionState.NCache

This contains a custom ASP.NET session state provider using NCache Enterprise.

AspNet.SignalR.NCache

A backplane using NCache Enterprise messaging service for scaling out ASP.NET SignalR applications.

Lucene.Net.NCache

An SDK that uses lucene.NET API with NCache Enterprise to scale out full-text searching.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on Alachisoft.NCache.SDK:

Repository Stars
Avanade/Liquid-Application-Framework
Liquid Application Framework documentation, useful links and sample project
Version Downloads Last Updated
5.3.7.1 186 7/22/2026
5.3.7 859 7/16/2026
5.3.6.1 33,155 10/1/2025
5.3.6 16,329 8/12/2025
5.3.5.3 13,970 9/16/2025
5.3.5.2 13,864 9/4/2025
5.3.5.1 16,382 5/26/2025
5.3.5 16,354 5/8/2025
5.3.5-beta 365 4/23/2025
5.3.4 50,623 5/30/2024
5.3.3.1 20,991 3/7/2024
5.3.3 47,143 2/1/2024
5.3.2.1 20,724 1/29/2024
5.3.2 33,829 9/27/2023
5.3.1.1 26,326 9/8/2023
5.3.1 103,785 9/12/2022
5.3.0 37,203 4/12/2022
5.2.1 54,141 10/12/2021
5.2.0.1 19,845 7/2/2021
Loading failed