[英]System.Security.Cryptography.CryptographicException: The system cannot find the file specified
[英]CngKey System.Security.Cryptography.CryptographicException The system cannot find the file specified on Azure
我尝试从此代码生成密钥
CngKey key = CngKey.Import(Convert.FromBase64String(privateKey), CngKeyBlobFormat.Pkcs8PrivateBlob);
它在本地运行良好,但是当我在我的 Azure 应用服务中部署时。 它给了我这个错误:
System.Security.Cryptography.CryptographicException:系统找不到指定的文件。 在 System.Security.Cryptography.NCryptNative.ImportKey(SafeNCryptProviderHandle 提供程序,Byte[] keyBlob,字符串格式)在 System.Security.Cryptography.CngKey.Import(Byte[] keyBlob,字符串曲线名称,CngKeyBlobFormat 格式,CngProvider 提供程序)
我在配置中添加了 WEBSITE_LOAD_USER_PROFILE,值为“1”,但没有任何区别。
谢谢
如果WEBSITE_LOAD_USER_PROFILE = 1
对您不起作用。 这是同一问题的解决方法:
查看以下链接以获取类似问题以供参考:
我通过在 Azure 配置中添加 WEBSITE_LOAD_USER_PROFILE = 1 将计划服务从免费升级到基本服务。
问题是当应用服务免费时,它使用共享虚拟机,但是当我的应用服务定价升级到基本时,它使用私有虚拟机。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.