Failed to encrypt web.config with error "The RSA key container could not be opened" RRS feed

  • Question

  • User664609406 posted

    I have tried to encrypt the web.config using the command

    "C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe" -pef appSettings E:\temp\Test

    But we got the error: "The RSA key container could not be opened".

    And we have done the following tries, but still no luck.

    1. Check the permission settings on the folder and its sub folders "C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA", to ensure the logged-on user has permissions to these folders.

    2. Run the command as Administrator from command prompt.

    3. Check the machine.config, to ensure the default key container name is not changed. The default value "NetFrameworkConfigurationKey" is not changed.

    4. We also tried the command, but we still got the same error.

    "C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe" -pd "appSettings" -site mysite -app "/"

    Would you please advise how I could move forward to encrypt the configuration file?

    And by the way, is there a way to list all the container name on the machine?





    Tuesday, April 9, 2013 5:34 AM


  • User-782344923 posted


    Similar thread also present here. Visit this to fix your issue


    Or read MSDN Article on Encypt config sections using RSA



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, April 9, 2013 5:37 AM