I have an ASP.NET application that is part of a much larger system; it reads most of its configuration from files that are above the root level of the web application.
As the application is already written and the format of the configuration files was chosen to ease editing by customers I cannot make use of the solution in “Shared configuration files in .NET”.
I am hoping ASP.NET has an API I can call at startup time to tell it which file to watch. (I could write this the hard way using a “FileSystemWatcher” and catching events then doing the restart myself, however that would be a pity as ASP.NET already has the code to watch files and restart when they are changed.)
Also what ASP.NET API do I call to get ASP.NET to restart in a nice way?
These are some links I have found that may help: Using the FileSystemWatcher from ASP.NET and Extending FileSystemWatcher to ASP.NET
In one case I cached the configuration in the ASP.NET Cache and set a CacheDependency to the file. In the other case that needed faster access, I used a FileSystemWatcher and updated a static field when the configuration changed.
(I never did find out how to restart ASP.NET from code in a reasonable way.)