I have an Asp.net application that is part of a match larger system, it reads most of it’s 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 can not make use of the solution in “Shared configuration files in .NET”.
I am hoping Asp.net has an API I can call at start uptime to tell it witch 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 Aps.net API do I call to get Aps.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.)