0
我已經加密了我的WCF Webconfig,然後我用實際的webconfig文件替換了我的加密的webconfig。WCF webconfig加密問題
現在問題是項目不能在我的電腦上工作,它可以在其他系統上正常工作。
加密按如下規則進行:
string provider = "RSAProtectedConfigurationProvider"; // or "DataProtectionConfigurationProvider"
string section = "connectionStrings";
protected void EncriptionWebConfig()
{
System.Configuration.Configuration confg;
if (HttpContext.Current != null)
confg = WebConfigurationManager.OpenWebConfiguration("~");
else
confg = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
ConfigurationSection confStrSect = confg.GetSection(section);
if (confStrSect != null)
{
confStrSect.SectionInformation.ProtectSection(provider);
confg.Save();
}
}
錯誤是:
無法使用提供解密 'RsaProtectedConfigurationProvider'。從提供 錯誤消息:RSA密鑰容器不能打開
但我在同一臺機器上,它在其他機器上工作,但不在我的機器上 – 2011-06-17 08:33:47
是同一個應用程序加密和解密? – GunnerL3510 2011-06-17 17:33:40