Aspnetcore.docs: AddStackExchangeRedisCache in 2.2 version

Created on 23 Apr 2019  ·  12Comments  ·  Source: dotnet/AspNetCore.Docs

Hi,

I select 2.2 version (in the dropdown) and the page shows AddStackExchangeRedisCache for Redis cache, though AddStackExchangeRedisCache seems to be included only in version 3.

(In 2.2 still AddDistributedRedisCache)

BTW what's the need to rename?

[Enter feedback here]


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

P4 Source - Docs.ms

Most helpful comment

That's the old package. Don't use Microsoft.Extensions.Caching.Redis. Use .........

add nuget package Microsoft.Extensions.Caching.StackExchangeRedis

All 12 comments

I'm going to close as answered, but we can re-open this if you'd like to discuss it further.

Why close? I open documentation for 2.2 and it shows methods from 3.

No ... the method is for >=2.2 ... both 2.2 and 3.0+.

Why do you think that AddStackExchangeRedisCache isn't available for 2.2?

https://docs.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.stackexchangerediscacheservicecollectionextensions.addstackexchangerediscache?view=aspnetcore-2.2

Do u have the wrong package reference ...

Did you go with Microsoft.Extensions.Caching.StackExchangeRedis?

~Topic looks like it has a bad reference tho further down on Line 42. I'll take a look shortly ... I'm 🏃 at the moment.~

Nope ... all good ... it's set up for 2.1 versioning. :+1:

ok ... just looked. It's good. The reference that I referred to is inside a 2.1 versioning block, so the topic seems ok.

New project -> Web API 2.2,
add nuget package microsoft.extensions.caching.redis
AddDistributedRedisCache available, AddStackExchangeRedisCache NOT available

That's the old package. Don't use Microsoft.Extensions.Caching.Redis. Use .........

add nuget package Microsoft.Extensions.Caching.StackExchangeRedis

I think we're ok here. Looks like you just need to change the package reference. The topic seems ok ......

For the 2.1 version of the topic, it shows Microsoft.Extensions.Caching.Redis.

For the >=2.2 version, it shows Microsoft.Extensions.Caching.StackExchangeRedis.

I'm not sure why they changed the package name, namespaces, methods, etc. We'd need to ask the engineers over on the aspnet/Extensions repo, but I doubt that it's worth the trouble. Whatever the reason(s), this is what they want everyone to use now.

Thanks for clarification! :)
I didn't notice the package change.
Really strange why everything changed so much...

Microsoft.Extensions.Caching.StackExchangeRedis not work on 3.0

Was this page helpful?
0 / 5 - 0 ratings