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

时间:2019-10-21 03:47:32

标签: c# .net asp.net-core .net-core

根据Distributed caching in ASP.NET Core

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

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

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

1 个答案:

答案 0 :(得分:1)

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

在链接文档状态中较高的Prerequisits部分,您需要添加对程序包Microsoft.Extensions.Caching.StackExchangeRedis的引用