无法在Dotnet Core 3.0中使用Redis缓存

Tan*_*onk 4 .net c# .net-core asp.net-core

根据ASP.NET Core 中的分布式缓存

据说我可以使用Microsoft.Extensions.Caching.StackExchangeRedisservices.AddStackExchangeRedisCache使用ConfigureServices

Microsoft.Extensions.Caching.StackExchangeRedis但是dotnet core 3.0 上不存在命名空间。

只有using Microsoft.Extensions.Caching.Memory;并且using Microsoft.Extensions.Caching.Distributed;存在

Phi*_*ill 10

https://learn.microsoft.com/en-us/aspnet/core/performance/caching/distributed?view=aspnetcore-3.0#preventions

Prerequisits链接文档上方的部分表明您需要添加对包的引用Microsoft.Extensions.Caching.StackExchangeRedis