Solved

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

Posted on 2011-09-06
5
426 Views
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.
0
Comment
Question by:lsassano
[X]
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
5 Comments
 
LVL 5

Accepted Solution

by:
zvytas earned 250 total points
ID: 36491872
0
 

Author Comment

by:lsassano
ID: 36491992
zvytas,

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?

thanks
0
 
LVL 75

Expert Comment

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

Expert Comment

by:zvytas
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).
0
 

Author Comment

by:lsassano
ID: 36495498
My application is a windows service
0

Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

737 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