Connection string encryption error

Topics: Data Access Application Block, General discussion
Apr 7, 2010 at 2:38 PM


I'm using DAAB (4.1) to create connection strings in a config file. I then set the Protection for the DAAB to RsaProtectedConfigurationProvider. This encrypts my config file and all is working well. However when I package this winforms application and install on someone elses machine I get the following error reported.

"The RSA key container could not be opened"

There are plenty of references for this around creating and exporting Custom Key containers but they all seem to be aimed at web.config files and they don't appear to help in my situation.

Any help would be appreciated.


Apr 8, 2010 at 3:35 AM

You would still use aspnet_regiis to create, export and import key containers. You would create the key container in the machine where you created the config file, export it to a file and then import it in the other machine. In that machine you would grant access to the key container to the account that will need to read the configuration.

Here's a related thread:

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.