We are using a custom config section (via the NameValueConfigSection) to contain our settings. These settings are externalised from web.config via configSource.
So, entries in web.config look something like this:
<configSections>
<section name="customSettings" type="System.Configuration.NameValueSectionHandler" />
</configSections>
<customSettings configSource="config\customSettings.config" />
We want to encrypt this "customSettings.config" file on our production server, so run this command, as recommended by Microsoft (here: http://msdn.microsoft.com/en-us/library/zhhddkxy.aspx)
aspnet_regiis -pe customSettings -site 4 -app /
And this produces the following output:
Encrypting configuration section...
Succeeded!
However, it does not succeed at all, leaving the file exactly as it was
(incidentally, this command does work if encrypting a non-custom section, such as an externalised connectionStrings section)
I have been able to write a little console app that does work ok, but we really want to use the standard tools to do what should be a standard operation - can anyone tell me if this is a limitation or where I am going wrong?
Thanks :)