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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pmonte
    New Member
    • Jul 2009
    • 7

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

    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
    Recognized Expert Contributor
    • Jul 2008
    • 569

    #2
    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

    Comment

    Working...