title: Unrecognized attribute 'configProtectionProvider' after encrypting app.config
body: <p>I run the following method at the beginning of my application passing in a section living under applicationSettings:</p>
  
  <pre><code>public static void EncryptConfigSection(string sectionKey)
      {
          Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
          ConfigurationSection section = config.GetSection(sectionKey);
          if (section != null)
          {
              if (!section.SectionInformation.IsProtected)
              {
                  if (!section.ElementInformation.IsLocked)
                  {
                      section.SectionInformation.ProtectSection("RSAProtectedConfigurationProvider");
                      section.SectionInformation.ForceSave = true;
                      config.Save(ConfigurationSaveMode.Full);
                      ConfigurationManager.RefreshSection(sectionKey);
                  }
              }
          }
      }
  </code></pre>
  
  <p>Here's an example of the section in the app.config:</p>
  
  <pre><code>&lt;applicationSettings&gt;
    &lt;Example.Properties.Settings&gt;
      &lt;setting name="Key" serializeAs="String"&gt;
        &lt;value&gt;Value&lt;/value&gt;
      &lt;/setting&gt;
    &lt;/Example.Properties.Settings&gt;
  &lt;/applicationSettings&gt;
  </code></pre>
  
  <p>When I try to access any of the settings from the  section, I receive the following error:</p>
  
  <blockquote>
    <p>Unrecognized attribute 'configProtectionProvider'</p>
  </blockquote>
  
  <p>This is a desktop application that needs to encrypt some settings when starting then decrypt when exiting.</p>
  
  <p>Does anyone have a solution for this issue?</p>