今天在部署asp.net core网站时,因为调用到阿里云的api,api的参数需要加密签名,系统报出了如下错误:
warn: Microsoft.Extensions.DependencyInjection.DataProtectionServices[59]
Neither user profile nor HKLM registry available. Using an ephemeral key repository. Protected data will be unavailable when application exits.
warn: Microsoft.AspNetCore.DataProtection.Repositories.EphemeralXmlRepository[50]
Using an in-memory repository. Keys will not be persisted to storage.
fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[0]
上网搜了下应该是某些安全机制引起的吧。
具体请自行查看一下文章:Asp.net core Data Protection : https://docs.asp.net/en/latest/hosting/dataprotection.html
github: https://github.com/aspnet/DataProtection/issues/102
反正我是大致看了下这两篇文章后找到解决方案的,但是详细原因嘛,英文还不过关。
使用 PowerShell执行第一篇文章提供的脚本。注意,Powershell 有可能会提示“此系统中禁止执行脚本”,那么按照提示先执行“se