开发者

Dynamically reading app.settings in asp.net

开发者_StackOverflow中文版I've moved my appsettings section outside of the web.config using:

   <appSettings configSource="AppSettings.config"/>

This allows me to change my appsettings without actually restarting IIS.

I know however, that IIS monitors all configuration files constantly. How can I attach to event my-appsetting-has-changed to take some custom action upon that?


According to this reference and this reference,

[The] ASP.Net runtime does not detect when the external [config] file changes.

If that's true, then you might get some mileage out of the FileSystemWatcher, but I cannot think how to use that effectively in an ASP.NET scenario.

I hope this helps.


You can use the FileSystemWatcher class for this.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜