tags:

views:

59

answers:

3

Hi, Anyone have a pointer to a C# configuration class that a .NET service can use to do configurations via an admin socket or other control port? I'd rather do this than a filewatcher on the app.config file.

We have some long running C#/.NET services (24h X 6.5 days/week) that may need to be re-configured on the fly. I'm looking for a good way to push out config changes to a .NET service

Any pointers appreciated.

Craig

+1  A: 

How about exposing a WCF service for configuration purposes? That way you can get a nicely typed API for configuration of the service.

Manga Lee
+1 I've found exposing a WCF service very handy for config and management of a windows service
SpaceghostAli
SpaceghostAli, do you have any examples of how to do this ?
Craig
A: 

To expand on Manga's answer;

I'd recommend hosting a WCF endpoint on the same IIS box hosting your long running C#/.NET services. This endpoint run on an arbitrary port.

Its responsiblity would simply be to change the appconfig(s) of your running service(s). You could specify a config type decorated with DataContract to allow for a nice configuration API exposed to the client responsible for pushing the config changes.

Janie
A: 

I'm not experienced with WCF, but I've typically solved this problem by rolling my own API via RPC. Expose some methods to add/remove/update certain configuration items, throw some sort of UI on top of it, and you can update your service on the fly.

Curtin