What is the best way for appliiction to reload app.config and parameters when app.config changes

Posted on 2011-09-06
Medium Priority
Last Modified: 2012-06-21
I want my .net service application to detect when the app.config file has changed and reload the settings. My settings are in the 'applicationSettings' of the app.config.
Question by:lsassano
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2

Accepted Solution

zvytas earned 1000 total points
ID: 36491872

Author Comment

ID: 36491992

Thanks for you quick reply.  I have a few details to ask though.
Is wiring the filesystemwatcher events to the app.config enough or are there other factors to consiider ie caching. When handling the changed event would the properties in the applicationSettings be able to be read lets say in Settings.Default.<settings name>?

Do you have any code snippets directly pertaining to app.config file?

LVL 75

Expert Comment

by:käµfm³d 👽
ID: 36492159
I want my .net service application
Web service or windows service?

Expert Comment

ID: 36493604
Caching will not occur, so that's not a problem. Read your config file as normal (i.e. you the same code you used to read the config when service starts).

Author Comment

ID: 36495498
My application is a windows service

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question