重新加载配置,而无需使用ConfigurationManager.RefreshSection重新启动应用程序 [英] Reloading configuration without restarting application using ConfigurationManager.RefreshSection

查看:2029
本文介绍了重新加载配置,而无需使用ConfigurationManager.RefreshSection重新启动应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人得到了在Web应用程序这方面的工作?

Has anyone got this working in a web application?

不管我做什么,似乎我的appSettings节(使用的web.config文件的appSettings重定向=\\网站\\ site.config)没有得到重新加载。

No matter what I do it seems that my appSettings section (redirected from web.config using appSettings file=".\Site\site.config") does not get reloaded.

难道我注定要不得不只需重新启动应用程序的情况下?我希望这种方法将导致我更高性能的解决方案。

Am I doomed to the case of having to just restart the application? I was hoping this method would lead me to a more performant solution.

更新:

通过'重装'我的意思是清爽ConfigurationManager.AppSettings无需完全重新启动我的ASP.NET应用程序,并且承担平时的启动延迟。

By 'reloading' I mean refreshing ConfigurationManager.AppSettings without having to completely restart my ASP.NET application and having to incur the usual startup latency.

推荐答案

请确保您传递正确的区分大小写价值RefreshSection,即

Make sure you are passing the correct case sensitive value to RefreshSection, i.e.

ConfigurationManager.RefreshSection("appSettings");

这篇关于重新加载配置,而无需使用ConfigurationManager.RefreshSection重新启动应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆