Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / February 2008

Tip: Looking for answers? Try searching our database.

configuration data for service?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
James - 10 Feb 2008 05:20 GMT
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
Mufaka - 10 Feb 2008 06:33 GMT
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.
James - 10 Feb 2008 15:22 GMT
> My first thought is that the initial configuration for this should be
> done at deployment time, so it shouldn't matter.
[quoted text clipped - 3 lines]
> 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
Peter Bromberg [C# MVP] - 11 Feb 2008 02:47 GMT
Yes, but you would need to provide a mechanism for your Service to reload and
use the revised configuration data. A FileSystemWatcher can do this. See this
article on a self-updating service for some ideas:
http://www.eggheadcafe.com/articles/20041204.asp
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com 

> > My first thought is that the initial configuration for this should be
> > done at deployment time, so it shouldn't matter.
[quoted text clipped - 12 lines]
>
> -jr
sloan - 11 Feb 2008 02:54 GMT
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.

..

>I have a service which needs configuration data. I am currently using
> userSettings and applicationSettings through VS settings manager. They
[quoted text clipped - 15 lines]
>
> -jr

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.