Are there any events that will fire if someone edited my custom made application config? I wanted to know such changes and apply it on my application.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If this is a web application, then this happens automatically.
If it’s non-web (and you have an app.config), use FileSystemWatcher to monitor the file. When the event files, restart the application (use Application.Restart()) – or just re-load your configuration values in whatever way you initially did. Like, if you have a public read-only property in a “Settings” class, just re-load the settings on that event. Hope that helps.