You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[System.Runtime.Caching](https://learn.microsoft.com/en-us/dotnet/api/system.runtime.caching?view=dotnet-plat-ext-7.0) ([NuGet package](https://www.nuget.org/packages/System.Runtime.Caching/)) is a packaged set of simple caching API's derived from those of the same namespace available in .Net Framework since 4.0. This package is intended for use as a bridge when porting .Net Framework applications to .Net Core.
4
+
5
+
This `System.Runtime.Caching` package can be used with any [.NET implementation](/dotnet/standard/net-standard#net-implementation-support) that targets .NET Standard 2.0 or later. For example:
6
+
* .NET Core 3.1 or later.
7
+
* .Net Framework 4.5 or later.
8
+
* .Net 5.0 or late
9
+
10
+
[Microsoft.Extensions.Caching.Memory](https://www.nuget.org/packages/Microsoft.Extensions.Caching.Memory/)/[IMemoryCache](https://learn.microsoft.com/en-us/aspnet/core/performance/caching/memory?view=aspnetcore-7.0) is recommended over `System.Runtime.Caching`/`MemoryCache` because it's better integrated into ASP.NET Core. For example, `IMemoryCache` works natively with ASP.NET Core [dependency injection](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-7.0).
11
+
12
+
> > [!IMPORTANT]
13
+
> Use `System.Runtime.Caching`/`MemoryCache` as a compatibility bridge when porting code from .NET 4.x to .NET Core.
14
+
15
+
16
+
## Main Types
17
+
18
+
The main types provided by this library are:
19
+
20
+
*`System.Runtime.Caching.MemoryCache`
21
+
22
+
## Remarks
23
+
24
+
[MemoryCache.PhysicalMemoryLimit](https://learn.microsoft.com/en-us/dotnet/api/system.runtime.caching.memorycache.physicalmemorylimit?view=dotnet-plat-ext-7.0) property is only supported on windows.
25
+
26
+
## Addtional Documentation
27
+
28
+
*[Caching in .NET](https://learn.microsoft.com/en-us/dotnet/core/extensions/caching)
29
+
*[Cache in-memory in ASP.NET Core](https://learn.microsoft.com/en-us/aspnet/core/performance/caching/memory?view=aspnetcore-7.0)
System.Runtime.Caching is released as open source under the [MIT license](https://licenses.nuget.org/MIT). Bug reports and contributions are welcome at [the GitHub repository](https://github.com/dotnet/runtime).
0 commit comments