Author: nsourabh | Posted on: 9/16/2009 11:19:15 PM | Views : 582

Hi,
I have a solution that contains Windows Service Application. This application has app.config file that stores the connection strings and Appsettings. To encrypt these sensitive information, i am using the protectsection and unprotectsection with 'RsaProtectedConfigurationProvider'. These methods are written in a class "UsingRsaProtectedConfigurationProvider", in the WindowService project.
I have created a console application in the same solution. These console application calls the protectsection() method of class "UsingRsaProtectedConfigurationProvider" while encrypting. These console application is executed first to encrypt the app.config values.

However, when i start the windows service, it gives me an error "Failed to decrypt using provider 'RsaProtectedConfigurationProvider'. Error message from the provider: The RSA key container could not be opened."
I am pasting the inner exeception here. ...

Go to the complete details ...