title: Failed to decrypt using provider 'RsaProtectedConfigurationProvider'?
body: <p>In my windows application i am trying to encrypt connection string section of app.config file, connection string part of my app.config file is</p>
  
  <pre><code>&lt;connectionStrings&gt;
  &lt;add name="SQLiteDB" connectionString="Data Source=|DataDirectory|database.s3db;    
  Version=3;password=mypassword;" providerName="System.Data.Sqlite"/&gt;
  &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>and in .cs file i am encrypting it like</p>
  
  <pre><code>Configuration config = ConfigurationManager.OpenExeConfiguration(Application.ExecutablePath);
  ConfigurationSection section = config.GetSection("connectionStrings") as ConnectionStringsSection; // could be any section
  
  if (!section.IsReadOnly())
  {
   section.SectionInformation.ProtectSection("RsaProtectedConfigurationProvider");
   section.SectionInformation.ForceSave = true;
   config.Save(ConfigurationSaveMode.Full);
  }
  </code></pre>
  
  <p>after running this code i get encrypted connection string in a different app.config, this app.config resides in bin\debug folder and the name of this .config file is nameofapplication.exe.config.</p>
  
  <p>The problem is when i made setup of this application and run on other machine if gives error that:</p>
  
  <pre><code>System.Configuration.ConfigurationErrorsException: Failed to decrypt using provider 'RsaProtectedConfigurationProvider'. Error message from the provider: The RSA key container could not be opened.
  </code></pre>
  
  <p>I am doing it first time so don't know how to solve this, stucked badly in it.</p>