17Sep
How to programmatically determine when Web.Config Changes?
Posted by admin as .Net, Asp.Net, Microsoft, Technology, Web
On some occasions you would want to run some code for every change in the configuration file, like reload the cache etc.. A change in web.config prompts the app domain to reload. So one should be able to look for application domain shutdown reason to verify a configuration change. Here is how you do can do it
In you Global.asax.cs file add the following code
protected void Application_End(object sender, EventArgs e) { if (HostingEnvironment.ShutdownReason ==
ApplicationShutdownReason.ConfigurationChange)
{
// Do Something
}
}
Hope this helps someone.

2 Responses to How to programmatically determine when Web.Config Changes?
pressyger
August 14th, 2010 at 3:15 pm
как научиться быстрей читать
Uniobbylisy
August 28th, 2010 at 10:20 pm
настоящий сайт для женщин