-->

无法加密的节“的ConnectionStrings”使用提供商RsaProtectedConfigu

2019-08-17 12:51发布

无法将部分“的ConnectionStrings”使用提供商RsaProtectedCo nfigurationProvider'进行加密。 从供应商的错误消息:对象已存在。

我也跟着在引导http://msdn.microsoft.com/en-us/library/2w117ede.aspx ,但在第3步中要授予ASP.NET身份访问RSA密钥容器,它说,我的身份是我的工作组\用户名,我没有冒充我的web.config文件中,虽然

我使用asp_regiis使用我的机器加密的web.config,然后使用Visual Studio调试,然后才出现了这个错误

Answer 1:

对于使用RsaProtectedConfigurationProvider您需要启动命令提示符或Visual Studio 以管理员身份

对于DataProtectionConfigurationProvider它并不需要在管理员权限运行。



Answer 2:

您可以使用RsaProtectedConfigurationProvider没有管理员权限来加密你的web.xml中创建自己的供应商。

  1. 创建密钥存储区:

    ASPNET_REGIIS -pc “MyKeyStore” -exp

  2. 格兰特阅读任何用户访问:

    aspnet_regiss -pa “MyKeyStore” “域/用户”

  3. 将一个供应商节中你的web.config

     <configProtectedData> <providers> <add name="MyRSAProvider" type="System.Configuration.RsaProtectedConfigurationProvider,System.Configuration, Version=2.0.0.0,&#xD;&#xA; Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a,&#xD;&#xA; processorArchitecture=MSIL"keyContainerName="MyKeyStore"useMachineContainer="true" /> </providers> </configProtectedData> 
  4. 加密你的配置部分:

    ASPNET_REGIIS -pef “configSection” “C:\ pathToWebConf” -prov “MyRSAProvider”

资料来源:

创建RSA密钥容器和供应商

加密配置



Answer 3:

这件事发生在我的服务器全部尝试从C盘到另一个驱动器移动Web应用程序之一。

因为我已经加密的驱动器C上的web.config部分,并将其移动到另一个驱动器,它卡住了供应商导致它失败,因为它认为它已经存在加密部分。

我仍然在试图修复它。



文章来源: Failed to encrypt the section 'connectionStrings' using provider 'RsaProtectedConfigurationProvider