Возникла проблема при шифровании app.config. При старте приложения выполняется проверка, если секции не зашифрованы – зашифровать.
Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
if (!config.GetSection("appSettings").SectionInformation.IsProtected)
{
Settings settings = new Settings (ProtectionProvider.RSAProtectionProvider, config);
settings.EncryptWholeConfiguration();
ConfigurationManager.RefreshSection("configuration");
}
Если затем конфиг изменить, схранить и попытаться считать вылетает следующая ошибка:
"Unrecognized attribute 'configProtectionProvider'. Note that attribute names are case-sensitive.”
Source: "System.Configuration"
Посоветуйте, пжст, как решить.