I am using Microsoft.AspNetCore.DataProtection
in ASP.NET Core 2.0 application for data protection. And for the default settings I have added below code in Startup.cs
file
public IServiceProvider ConfigureServices(IServiceCollection services)
{
services.AddDataProtection().ProtectKeysWithDpapi();
...
...
}
But that code throws an error:
InvalidOperationException: The 'IXmlRepository' instance could not be found. When an 'IXmlEncryptor' instance is set, a corresponding 'IXmlRepository' instance must also be set.
Did I miss something in this implementation?