Install NuGet Packages for .NET Clients
NCache provides NuGet packages that include client libraries for integrating distributed caching into your .NET applications. To get started, install the appropriate NCache SDK NuGet package using Visual Studio (Package Manager Console) or the .NET CLI. These packages enable key caching features such as distributed caching, ASP.NET Core sessions, SignalR, response caching, data protection, and Entity Framework second-level caching. The client libraries support .NET Framework 4.7.2+ and .NET 6/7/8, and all packages follow a consistent versioning pattern aligned with your NCache installation.
Steps to Install NCache SDK NuGet Package
Open Visual Studio and go to Tools -> NuGet Package Manager -> Package Manager Console.
On the console, execute the required command to install the NCache SDK NuGet package according to your requirements.
Note
Replace x.x.x with the version of NCache you are using.
Install-Package Alachisoft.NCache.SDK -Version x.x.x
Install-Package Alachisoft.NCache.OpenSource.SDK -Version x.x.x
You can also install NuGet packages for the following .NET Integrations:
ASP.NET Core Sessions
Install-Package AspNetCore.Session.NCache -Version x.x.x
Install-Package AspNetCore.Session.NCache.OpenSource -Version x.x.x
ASP.NET Core SignalR
Install-Package AspNetCore.SignalR.NCache -Version x.x.x
Install-Package AspNetCore.SignalR.NCache.OpenSource -Version x.x.x
ASP.NET Core Response Caching
Install-Package NCache.Microsoft.Extensions.Caching -Version x.x.x
Install-Package NCache.Microsoft.Extensions.Caching.OpenSource -Version x.x.x
Install-Package AspNetCore.ResponseCache.NCache -Version x.x.x
ASP.NET Core Data Protection Provider
Install-Package AspNetCore.DataProtection.NCache -Version x.x.x
ASP.NET Sessions
Install-Package AspNet.SessionState.NCache -Version x.x.x
Install-Package AspNet.SessionState.NCache.OpenSource -Version x.x.x
ASP.NET SignalR
Install-Package AspNet.SignalR.NCache -Version x.x.x
Install-Package AspNet.SignalR.NCache.OpenSource -Version x.x.x
ASP.NET View State Caching
Install-Package AspNet.ViewState.NCache -Version x.x.x
ASP.NET Output Cache Provider
Install-Package AspNet.OutputCache.NCache -Version x.x.x
Entity Framework Core
Install-Package EntityFrameworkCore.NCache -Version x.x.x
Entity Framework 6
Install-Package EntityFramework6.NCache -Version x.x.x
Supported .NET Versions
The supported .NET versions are as follows:
| Product | Versions |
|---|---|
| .NET | 6.0, 7.0, 8.0 |
| .NET Framework | 4.7.2, 4.8, 4.8.1 |
| .NET Standard | 2.0, 2.1 |
For other types of applications, this should work fine without any configuration changes.
Note
If you must use .NET Framework 4.6.2 and encounter any issues, please refer to the troubleshooting section.
Note
For server-side deployments, .NET Standard 2.0, .NET 8.0, and .NET 4.8 are the supported versions.
Important
Ensure that you are using the JSON Serialization format for .NET 8.0 and .NET 6.0, as BinaryFormatter Serialization methods are obsolete and insecure.
- In .NET 6.0,
BinaryFormatteris disabled by default. - In .NET 8.0,
BinaryFormatteris completely prohibited.