configuration data for service?

J

James

I have a service which needs configuration data. I am currently using
userSettings and applicationSettings through VS settings manager. They
are stored in the Service.exe.config file along with the service. I
have an application which manages the service and it communicates via
remoting. I have remoting methods to update the configuration data.
The problem with this is that the service must be running in order to
configure it. But there are some settings which you really should
configure before you run it..

What is the best way to provide configuration data for services? Just
write my own class put it in a common library to read/write values
from registry? Ideally, I would like to keep the VS functionality of
adding settings through the settings editor. The bottom line problem
is I need two applications (one a service) to be able to access the
same configuration data.

Any suggestions?

-jr
 
M

Mufaka

My first thought is that the initial configuration for this should be
done at deployment time, so it shouldn't matter.

Can you / Do you have default values for your configuration? If not and
that is feasible, I would add defaults in for at least your remoting
channel. If you can do this, let your service startup without
configuration and delay running other logic until configuration is saved.
 
J

James

My first thought is that the initial configuration for this should be
done at deployment time, so it shouldn't matter.

Can you / Do you have default values for your configuration? If not and
that is feasible, I would add defaults in for at least your remoting
channel. If you can do this, let your service startup without
configuration and delay running other logic until configuration is saved.

Yes, that is not a bad suggestion. Just make everything an application
setting and just modify the .config by hand before starting.. Maybe
I'm just over thinking it.. What about if I wanted a GUI to modify
those application settings can I use the Configuration Manager classes
to read the configuration files (if so any examples?) or should I just
roll my own XML parser to modify the configuration file?

-jr
 
S

sloan

You should look at the configuration stuff Greg Leake has done.

msdn.microsoft.com/stocktrader/

the configuration framework is different from the wcf stuff.

read the forums. there is a 1.1 refresh coming out soon which should
simplify deployment.

...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top