Connecting Tech Pros Worldwide Forums | Help | Site Map

How can I force a service to re-read the configuration from disk without restarting

Newbie
 
Join Date: Jul 2009
Posts: 1
#1: Jul 30 '09
I have a service that can be configured using a simple xml file. When the service starts it reads this xml.
I'd need to change the xml config file while the service is running (no probs so far) and having the service use this new version of the config. This can be done restarting the service or stop/start it. The point is that I cannot face "pauses", I'd need the service always up and running.
So I wonder if there's a way to tell the service to re-red the configuration from the disk instead of using the cached one.
Both command line/tool and C# code would be ok...

Thanks!

MrMancunian's Avatar
Expert
 
Join Date: Jul 2008
Location: Utrecht, The Netherlands
Posts: 283
#2: Aug 11 '09

re: How can I force a service to re-read the configuration from disk without restarting


Can't you write some code into your service that occasionally checks for a new version of the XML-file. Otherwise, I'm afraid you do need to restart your service.

Steven
Reply

Tags
service