El TecnoBaúl de Kiquenet

Kiquenet boring stories

Archive for the ‘Configuracion’ Category

Failed to decrypt using provider ‘RsaProtectedConfigurationProvider’

Posted by kiquenet en 19 mayo 2014

The error using ConfigurationManager and RsaProtectedConfigurationProvider section:

System.Configuration.ConfigurationErrorsException: Failed to decrypt using provider ‘RsaProtectedConfigurationProvider’. Error message from the provider: The RSA key container could not be opened.

The app.config file will have been encrypted using a certificate on your local machine. This certificate will not be present on the other machine. You will therefore not be able to decrypt the app.config file.

For this to work, you need to export the encryption key on your machine, then import it on the other machine. The following article demonstrates how to do that: Walkthrough: Creating and Exporting an RSA Key Container

This is the location where all of the keys are being put:

C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys


Using this command **aspnet_regiis -pa**

Open cmd Console -execute as Administrator-

    C:\Windows\system32>aspnet_regiis -pa "NetFrameworkConfigurationKey" "myDomain\myUser"
    Microsoft (R) ASP.NET RegIIS versión 4.0.30319.33440
    Utilidad de administración que instala y desinstala ASP.NET en el equipo local.
    Copyright (C) Microsoft Corporation. Todos los derechos reservados.
    Agregando ACL para el acceso al contenedor de claves RSA…
    Con éxito




More references:




Posted in .NET, Configuracion, Errores, Soporte | Etiquetado: , | Leave a Comment »

ConfigSource en sección Runtime

Posted by kiquenet en 13 noviembre 2012

El uso de configSource con la sección de configuración Runtime no parece funcionar bien.

A tener en cuenta:

So the conclusion is that (at least) the runtime section can’t be read from an external file, it will be ignored.

So the conclusion is still that the runtime section in an external file will be ignored (even if the file itself is actaully read).

La sección runtime se define de la siguiente manera:

 <section type="System.Configuration.IgnoreSection, System.Configuration, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" name="runtime" allowlocation="false" />

"IgnoreSection" being registered to handle "runtime" seems to suggest that this configuration is read by other means altogether, and apparently this other handling is not take configSource-aware.

According to the documentation


the assemblyBinding section defines a child element named <linkedConfiguration>.
This is used for "simplifying the management of component assemblies by allowing application configuration files to include assembly configuration files in well-known locations, rather than duplicating assembly configuration settings."


   <configuration><assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1"><linkedconfiguration href="file://c:\Program Files\Contoso\sharedConfig.xml"></linkedconfiguration></assemblybinding> 




Posted in .NET, Configuracion | Etiquetado: , , , | Leave a Comment »