I need to update a value in one of my custom configuration section in my app.config. Is there a good example on how to do this?
<mySection>
<level1>
<add data1="444"/>
</level1>
</mySection>
I want to update in 444 to 555 programmatically.
Assuming your configuration is stored in application.exe.config, the following should work.
I’m not sure if this will work for web.config as I have little experience with web apps and their configuration.
This technique will rewrite the configuration file but will not flush any internal configuration file caches. To force the configuration file to be reloaded (which may not be an issue in your application), you can call the following static method.