Kamlesh Delat
Kamlesh Delat

Reputation: 138

ProtectKeysWithCertificate Method not found in asp.net core DataProtection api

I got compile time error on add of ProtectKeysWithCertificate this line

public IServiceProvider ConfigureServices(IServiceCollection services)
{
    services.AddDataProtection()
        .SetApplicationName("Testervice")
        .ProtectKeysWithCertificate(newCert);
        //compile time error on ProtectKeysWithCertificate line
       //method not found
}

Upvotes: 2

Views: 537

Answers (1)

Kévin Chalet
Kévin Chalet

Reputation: 42100

As indicated in the documentation, ProtectKeysWithCertificate() is not available on .NET Core 1.0/1.1 (netcoreapp1.x).

If you want to use it, you can target the full .NET Framework (e.g net461).

Upvotes: 1

Related Questions