When using a windows service, is it better to use the start parameters or just have an app.config? -
When clicking on the properties of a window service, you can set the start parameter. Do you want to use it to configure a Windows service or to use AppConfig?
For a user, going to change the starting parameter of the service and looking for the install directory is very easy, open the app.config and edit it.
You feel that you have answered your question. ..
It really depends on the scenario of using your service and depends on the amount of configuration required for it.
As you said, the startup parameters make it easy because they are directly controlled in one place where the service is managed, however, they are not self-documenting and you still have a valid parameter Must provide documentation on what is there. They do not even lend themselves in a comprehensive configuration.
An app.config, on the other hand may be the document itself (xml comment), all possible configuration options are specified and you may have too many configurations
another To think about the other point is the number of deployments. If the service runs only on a few machines, with expert users (which XML understands), I bend to app.config files.
Comments
Post a Comment