G
Guest
I have started to use the new Enterprise Library (Jan 06) and have set up a
skeleton project using the DAAB. This all seems to work fine apart from when
I come to secure the app.config file via encryption.
I have encrypted the connectionsettings block in the config file but
obviously when I come to deploy the solution to other PC's, it cannot read
the block as it doesn't have the keys to decrypt.
I understand that as far as ASP.NET goes this is ok as the data layer is
most likely going to be on the web server, but for my winforms solution I
somehow have to let the user read this encrypted block?
I have even gone as far as to store all the connection information elsewhere
in the app.config file using other encryption routines, then letting the
application read these on startup and dynamically add a new connection string
in to the DAAB. Unfortunately this doesn't work either as the app.config
appears to be cached when the application starts and you cannot get framework
2.0 to "refresh" the app.config without exiting the application and
restarting.
I even had a go at this too! (Starting to pull my hair out now!) but of
course that gives a problem for developers in that unless we have different
app.config's for development and deployment (never a good move as it's bound
to get screwed up somewhere!) then the application simply re-copies the main
app.config everytime it starts up in debug mode so you get stuck in a
viscious circle!
I really think i must be missing something somewhere as at the moment it
appears that if you need to make the app.config secure when deployed, you
cannot use the new Enterprise Libraary DAAB at all!
(I've also tried to use RSA encryption as well - but could not find out how
to export the RSA keys from a Winforms application as opposed to an ASP.NET
web site).
And help or advice would be much appreciated to help save my sanity!
skeleton project using the DAAB. This all seems to work fine apart from when
I come to secure the app.config file via encryption.
I have encrypted the connectionsettings block in the config file but
obviously when I come to deploy the solution to other PC's, it cannot read
the block as it doesn't have the keys to decrypt.
I understand that as far as ASP.NET goes this is ok as the data layer is
most likely going to be on the web server, but for my winforms solution I
somehow have to let the user read this encrypted block?
I have even gone as far as to store all the connection information elsewhere
in the app.config file using other encryption routines, then letting the
application read these on startup and dynamically add a new connection string
in to the DAAB. Unfortunately this doesn't work either as the app.config
appears to be cached when the application starts and you cannot get framework
2.0 to "refresh" the app.config without exiting the application and
restarting.
I even had a go at this too! (Starting to pull my hair out now!) but of
course that gives a problem for developers in that unless we have different
app.config's for development and deployment (never a good move as it's bound
to get screwed up somewhere!) then the application simply re-copies the main
app.config everytime it starts up in debug mode so you get stuck in a
viscious circle!
I really think i must be missing something somewhere as at the moment it
appears that if you need to make the app.config secure when deployed, you
cannot use the new Enterprise Libraary DAAB at all!
(I've also tried to use RSA encryption as well - but could not find out how
to export the RSA keys from a Winforms application as opposed to an ASP.NET
web site).
And help or advice would be much appreciated to help save my sanity!