PC Review


Reply
Thread Tools Rate Thread

Automatic Updating of app.config

 
 
miannone
Guest
Posts: n/a
 
      11th Feb 2004
I was hoping someone could help me out.

I have created a WindowsService that runs periodically throughout the day using a timer. This windows service looks into a Microsoft SQL database and looks at a few tables and performs a few operations. It uses a app.config file to read in some settings, such as: database connection string, time to perform its operations, etc
This all works well, however if the app.config file is changes (ex. change the time to perform actions), the windows service is not updated unless you stop the service, build and reinstall it, and then start it up again. - which isnt an option

I have not tried changing the executableName.exe.config file, since I want to be able to change the app.config file directly. I have looked around on the internet and found many people with similar problems, but have not found a good solution to the problem.

As a last resort I could read directly from the app.config file periodically, but would much rather use ConfigurationSettings.AppSettings or something similar to that to automatically read in the values. I would rather not have the trouble of reading from the file manually, since if it is currently opened it may get complicated.
Currently when the time interval elapses and it checks which actions need to be performed, it also reads in the the config file using ConfigurationSettings.AppSettings. However, this information may be out of date. I would like a way to update this data somehow when the app.config file is manually changed while the windows service is running.

If anyone has encountered similar problems or has any suggestions as to how I can do this please let me know

Thanks

Mike.

---
Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest Community Website: http://www.dotnetjunkies.com/newsgroups/
 
Reply With Quote
 
 
 
 
miannone
Guest
Posts: n/a
 
      12th Feb 2004
I decided just to create my own xml configuration file. When I looked into it, it was a lot easier to set it up than I thought. Although using the app.config file would still be my preference.

---
Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest Community Website: http://www.dotnetjunkies.com/newsgroups/
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Page hang after updating web.config Joey Microsoft ASP .NET 5 6th Sep 2006 04:11 PM
web.config not updating Mark Microsoft ASP .NET 1 22nd Mar 2004 03:57 PM
Web.config; Dynamic Updating of Matt Microsoft ASP .NET 1 2nd Dec 2003 11:05 PM
Updating AppSettings in Web.Config programatically Rafael Veronezi Microsoft Dot NET Framework 1 7th Oct 2003 03:29 PM
Updating web.config on the fly Fiona Microsoft ASP .NET 1 2nd Jul 2003 09:04 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:23 PM.