make Registry subkey writable (#21342)
If not writable, sometimes you will suffer `UnauthorizedAccessException: Cannot write to the registry key.` I think a wide used docs should avoid that happen.pull/21352/head
parent
343603f3ac
commit
01de92107f
|
@ -122,7 +122,7 @@ Sometimes the app might not have write access to the file system. Consider a sce
|
||||||
public void ConfigureServices(IServiceCollection services)
|
public void ConfigureServices(IServiceCollection services)
|
||||||
{
|
{
|
||||||
services.AddDataProtection()
|
services.AddDataProtection()
|
||||||
.PersistKeysToRegistry(Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Sample\keys"));
|
.PersistKeysToRegistry(Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Sample\keys", true));
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue