NCache.Microsoft.Extensions.Caching
5.3.7
dotnet add package NCache.Microsoft.Extensions.Caching --version 5.3.7
NuGet\Install-Package NCache.Microsoft.Extensions.Caching -Version 5.3.7
<PackageReference Include="NCache.Microsoft.Extensions.Caching" Version="5.3.7" />
<PackageVersion Include="NCache.Microsoft.Extensions.Caching" Version="5.3.7" />
<PackageReference Include="NCache.Microsoft.Extensions.Caching" />
paket add NCache.Microsoft.Extensions.Caching --version 5.3.7
#r "nuget: NCache.Microsoft.Extensions.Caching, 5.3.7"
#:package NCache.Microsoft.Extensions.Caching@5.3.7
#addin nuget:?package=NCache.Microsoft.Extensions.Caching&version=5.3.7
#tool nuget:?package=NCache.Microsoft.Extensions.Caching&version=5.3.7
NCache.Microsoft.Extensions.Caching
An implementation of Microsoft.Extensions.Caching backed by NCache, allowing ASP.NET Core and .NET applications to use NCache as a distributed cache with minimal code changes. It integrates seamlessly with the Microsoft.Extensions.Caching.Distributed.IDistributedCache abstraction, making it a drop-in replacement for in-memory caching or other distributed cache providers — and can also be used for ASP.NET Core Response Caching.
Installation
Install-Package NCache.Microsoft.Extensions.Caching
or, using the .NET CLI:
dotnet add package NCache.Microsoft.Extensions.Caching
What is Installed
Installing this package adds the following NCache configuration files to your project:
- client.ncconf — Defines the cache client settings, including the cache name and the list of server nodes the client connects to.
- config.ncconf — Contains the cache configuration (cache topology, partitions, eviction policy, etc.) used when the cache is created/registered.
- tls.ncconf — Contains TLS/SSL settings used to secure communication between the client and the NCache cluster, if enabled.
Prerequisites
- .NET 6.0+ or .NETFramework4.6.2+ Application.
- An NCache 5.3.7 (or later) server should be up and running, with the target cache already created/registered on it.
Getting Started
Setting up NCache
Before running your application (if NCache is not installed on the current machine), you need to update client.ncconf so the client knows which cache to connect to and where to find it:
- Open
client.ncconf. - Locate the cache entry named
myCacheand rename it to the name of your actual cache (the cache you created/registered on the NCache server). - Under the
serversettings, update the server address to point to one of the nodes in the cluster where that cache is running.
Example:
<cache id="myCache" ... >
<server name="10.0.0.1" ... />
</cache>
Change myCache → YourCacheName, and 10.0.0.1 → the IP/hostname of a node hosting YourCacheName.
Setting up Package
Register NCache as the application's distributed cache provider in
Program.cs:builder.Services.AddNCacheDistributedCache(options => { options.CacheName = "YourCacheName"; options.EnableLogs = false; options.ExceptionsEnabled = true; });Inject
IDistributedCacheanywhere in your application to use the cache:using Microsoft.Extensions.Caching.Distributed; public class ProductService { private readonly IDistributedCache _cache; public ProductService(IDistributedCache cache) { _cache = cache; } public async Task SetValueAsync() { await _cache.SetStringAsync( "product:1", "Laptop", new DistributedCacheEntryOptions { AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(10) }); } public async Task<string?> GetValueAsync() { return await _cache.GetStringAsync("product:1"); } }The implementation supports all standard
IDistributedCacheoperations:Get()/GetAsync(),Set()/SetAsync(),Refresh()/RefreshAsync(), andRemove()/RemoveAsync().
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 | 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 | net461 was computed. net462 is compatible. 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. |
-
.NETFramework 4.6.2
- Alachisoft.NCache.SDK (>= 5.3.7.2)
- Microsoft.Extensions.Caching.Abstractions (>= 9.0.4)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.4)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.4)
-
.NETStandard 2.0
- Alachisoft.NCache.SDK (>= 5.3.7.2)
- Microsoft.Extensions.Caching.Abstractions (>= 9.0.4)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.4)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.4)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on NCache.Microsoft.Extensions.Caching:
| Package | Downloads |
|---|---|
|
Liquid.Cache.NCache
Distributed cache extension of NCache.Microsoft.Extensions.Caching. This component is part of Liquid Application Framework. |
|
|
PiCache
PiCache |
|
|
CachingService
Generic Caching Library |
GitHub repositories (2)
Showing the top 2 popular GitHub repositories that depend on NCache.Microsoft.Extensions.Caching:
| Repository | Stars |
|---|---|
|
Avanade/Liquid-Application-Framework
Liquid Application Framework documentation, useful links and sample project
|
|
|
referbruv/ContainerNinja.CleanArchitecture
ContainerNinja is a boilerplate template project to demonstrate building a multi-container Full Stack application with ASP.NET Core (.NET 6) Web API following Clean Architecture, and Angular.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 5.3.7 | 144 | 7/31/2026 |
| 5.3.6.1 | 3,236 | 10/10/2025 |
| 5.3.6 | 717 | 8/12/2025 |
| 5.3.5 | 368 | 5/30/2025 |
| 5.3.3 | 9,162 | 2/1/2024 |
| 5.3.1 | 15,138 | 9/12/2022 |
| 5.3.0 | 4,192 | 4/12/2022 |
| 5.2.1 | 4,557 | 10/12/2021 |
| 5.2.0 | 15,267 | 3/25/2021 |
| 5.1.0 | 11,989 | 11/23/2020 |
| 5.0.4.1 | 1,938 | 11/4/2020 |
| 5.0.4 | 2,191 | 10/28/2020 |
| 5.0.3 | 22,153 | 6/15/2020 |
| 5.0.2 | 2,433 | 1/17/2020 |