0

In my app config I'm using RSA Protected Configuration Provider, everything works fine when using it with connectionStrings section but NOT with unity section in app.config. Whenever I try to make this call:

container.LoadConfiguration("MyManager");

I get;

Unrecognized attribute 'configProtectionProvider'. Note that attribute names are case-sensitive. 

App.Config after encryption:

<unity configProtectionProvider="RsaProtectedConfigProvider">
    <EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element"
...

what gives?

ShaneKm
  • 20,823
  • 43
  • 167
  • 296

1 Answers1

0

Figured it out. I was missing this after the save:

                config.Save(ConfigurationSaveMode.Full);
                ConfigurationManager.RefreshSection(sectionName);
ShaneKm
  • 20,823
  • 43
  • 167
  • 296