Hello,
I'm trying to encrypt the <connectionStrings> in my web.config site using this code:
protected void btnProtect_OnClick(object sender, EventArgs e)
{
ProtectSection("connectionStrings", "DataProtectionConfigurationProvider");
}
private void ProtectSection(string sectionName, string provider)
{
Configuration config = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);
ConfigurationSection section =
config.GetSection(sectionName);
if (section != null &&
!section.SectionInformation.IsProtected)
{
section.SectionInformation.ProtectSection(provider);
config.Save();
}
}
I'm getting this error message:
Failed to map the path '/'.
on this line:
Go to the complete details ...