Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

610 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