Alec
Alec

Reputation: 966

Visual Studio cannot find the PersistKeysToRedis method of Microsoft.AspNetCore.DataProtection

Visual Studio claims it cannot find the PersistKeysToRedis method described here: https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.dataprotection.redisdataprotectionbuilderextensions.persistkeystoredis?view=aspnetcore-2.1

I am using dotnet core 2.1.302. I have the Microsoft.AspNetCore.All NuGet package installed, which as far as I can tell is all I need. I have most of the other methods described in that namespace as the following image shows:

PersistKeysToRedis missing

I have the Microsoft.AspNetCore.DataProtection namespace in my using statements.

So why do I not see this method? It's late on a Friday so maybe I'm missing something...

Upvotes: 3

Views: 3043

Answers (2)

Rohil Patel
Rohil Patel

Reputation: 478

Problem solved in my .net Core 3.1 app by installing nuget package,

Microsoft.AspNetCore.DataProtection.StackExchangeRedis (3.1)

Upvotes: 0

Severius5
Severius5

Reputation: 548

Your link says PersistKeysToRedis is in assembly Microsoft.AspNetCore.DataProtection.Redis. Microsoft.AspNetCore.All does not have a reference to this assembly so you need to add it manually.

Upvotes: 8

Related Questions