Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Edit App.config with no need to rebuild the app

Status
Not open for further replies.

EwS

Programmer
Dec 30, 2002
398
US
I have a Windows Service that reads the settings from the App.config file. If I need to make a change to one of the settings, I have to rebuild the app and reinstall the service. Is it possible to have this App.config file sitting in some directory and let the service know where it is so the values can be read this way? So I would just have to restart the service. Thank you.
 
What about using a settings file? You can alter that without having to recompile the program
 
App.config has a specific format. What format would this settings file have? Are you talking about .inf file?
 
Oh, I used it before, I just didn't realize I can change the settings values this way.

I'm not sure about the location of this Settings file though. My Windows Service gets installed under C:\windows\system32. But I would like the settigns file to reside in a specific folder. How do I do let the service know to look in that folder? Do I have to create an installer for my Windows service that lets you specify the installation path (right now I'm installing the service through the command prompt using installutil - can I specify the path there)?
 
I'm pretty sure that the user.config file (the result of using the settings file) gets save under your Application Data directory, but I'm not positive. I haven't looked into where it is stored.
 
Ok, but must the file reside under your installation directory (=where you installed your Windows service) or can you point the service to look for the settings file in another location?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top