Updating app config c

Configuration Section, Configuration Element and Configuration Element Collection require you to derive custom classes and implement custom Configuration Property properties. Here is an example of reading and writing to web.config: using System. Open Web Configuration("/"); string old Value = config. It is much easier to read AND write with (Web)Configuration Manager. Configuration; Configuration config = Web Configuration Manager. You could also create a custom configuration section yourself, however it would cause NHibernate to be improperly configured since it would not be able to load the config section properly. Combine(app Path, "App.config"); Exe Configuration File Map config File Map = new Exe Configuration File Map(); config File Map.

In case of using the exsiting one, I would do something like this: Properties. I think you give it a try yes, if the scope is user instead of application, this works. The answer to this question provide a link to a code to make applicationsettings portable. Xml; public class App Config File Settings It may be desired not to re-write the entire file, just to change one element. Modified); //relaod the section you modified Configuration Manager. If something in your app.config needs to change at runtime..possible there's a better place to keep that variable. At worst case something with a one time initialization.