Update App.Config during runtime?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I can read from, but not write to, App.Config during runtime. Is there a way to do this or am I out of luck

TIA

Bil
 
I can read from, but not write to, App.Config during runtime. Is there a way to do this or am I out of luck?

Out of the box, you CANNOT write back to the app.config file. Makes
sense, too - in most environments beyond a single stand-alone PC, your
app will most likely reside in a directory where the average user
doesn't have write access to, anyway.

If you really need to, you can always load the app.config file into an
XmlDocument and tinker around with it, and write it back.

Or go with one of the several enhanced config file handling
components, available e.g. from CodeProject.

http://www.codeproject.com/csharp/ReadWriteXmlIni.asp
http://www.codeproject.com/csharp/AnyConfig.asp
http://www.codeproject.com/vb/net/ConfigOpt.asp
http://www.codeproject.com/useritems/appdata.asp

Marc
================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
 
Back
Top