reloading app.config in Configuration Management Application Block ???

J

Jorge Besada

I am planning on using the Configuration Management Application Block.
The Block reads the app.config file the first time it is used. What if
I want to add a new section/configSection and have the
ConfigurationManager class reload the new app.config settings. Can
this be done? I am not interested in having my application be notified
that the settings file it is using has been changed. I am interested
in reinitializing the ConfigurationManager class once the app.config
file changes. Thanks
 
B

Brad Shook

I would not reccomend doing this. the app.comfig file was not really
designed to be modified in code after the program is installed and running.
It can be done but it very difficult. The only way I knoe how to do it is
load the config file into an xml document, make the changes and save it back
over the config file. I have seen example of this on Google groups. try
searching for vb.net change application.config file in code.
I would recomend using a simple ini file.

Brad Shook
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top