Mats,
If you use the standard app.config arrangement where the config file gets
named myService.exe.config, the configuration file is automatically read one
time at startup. For dynamic updating, you need to add a separate
filesystemwatcher and probably keep your dynamic settings in a separate
config file. A change in that would trigger re-reading the file without
having to stop the service. Actually, I use database entries and SQL Cache
Dependency as an alternative to that.
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"Mats-Lennart Hansson" wrote:
Hi,
In a windows service, I have some appSettings. If I during runtime changes
one of the values, is it availabele to the service from that moment? Or do I
have to restart the service before I can access the new value?
Ex.
I have this entry in my .config file:
<add key="Path" value="C:\test" />
and change it to:
<add key="Path" value="C:\someOtherFolder" />
Do I need to restart the service to be able to read the new value?
Thanks
/Mats-Lennart