It is been months but I still do not know how to read my encrypted app.config file using my windows form.
What I want to know is:
How can My WinForm application read a encrypted app.config file?
It always throws this exception
{"Failed to decrypt using provider 'RsaProtectedConfigurationProvider'. Error message from the provider: The RSA key container could not be opened. (C:\Users\jsumgo\Documents\Visual Studio 2010\Projects\MIPIR\MIPIR\bin\Debug\MIPIR.vshost.exe.Config line 18)"}
I know how to encrypt and decrypt the app.config, but my winform cannot read the values of my connection string.
I use connectionmanager
to read my connection string
Here is the code on how I read them
Public password As String = System.Configuration.ConfigurationManager.AppSettings("password")
Public userid As String = System.Configuration.ConfigurationManager.AppSettings("userid")
Public initcat As String = System.Configuration.ConfigurationManager.AppSettings("initcat")
Public dtsrc As String = System.Configuration.ConfigurationManager.AppSettings("dtsrc")
then I build these strings into my connection strings.
I would also like to know the process on how I could deploy this system with a encrypted app.config to my clients.
EDIT: I still cant get RSA to encrypt and read my connection string.