当前位置: 代码迷 >> ASP.NET >> vs2008网站公布出错
  详细解决方案

vs2008网站公布出错

热度:2224   发布时间:2013-02-25 00:00:00.0
vs2008网站发布出错
未能使用提供程序“RsaProtectedConfigurationProvider”进行解密。提供程序返回错误消息为: 打不开 RSA 密钥容器。 (c:\inetpub\wwwroot\web.config line 4)

高手能给一个直接的解决方案么。

------解决方案--------------------------------------------------------
你的web.config里面使用了加密?
------解决方案--------------------------------------------------------
aspnet_regiis -pa "NetFrameworkConfigurationKey" "NT AUTHORITY\NETWORK SERVICE"
------解决方案--------------------------------------------------------
参考文章:http://www.cnblogs.com/xryyforver/archive/2009/08/03/1537641

更灵活的解决方法:
1、创建一个密钥容器
aspnet_regiis -pc "ConnectionStringsKey" -exp

ConnectionStringsKey为密钥容器的名称
可以使用aspnet_regiis /?查看该命令的用法

2、在web.config中加入如下内容

 

Code
C# code
<configProtectedData>         <providers>             <clear />             <add name="ConnectionStringsKeyProvider"        type="System.Configuration.RsaProtectedConfigurationProvider, System.Configuration, Version=2.0.0.0,Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"         keyContainerName="ConnectionStringsKey"         useMachineContainer="true"/>         </providers> </configProtectedData>
------解决方案--------------------------------------------------------
去年加密的配置得了.
------解决方案--------------------------------------------------------
要加密就不要嫌麻烦
  相关解决方案