如何prevent ASP.NET应用程序重新启动时,web.config中被修改? [英] How to prevent an ASP.NET application restarting when the web.config is modified?

查看:125
本文介绍了如何prevent ASP.NET应用程序重新启动时,web.config中被修改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我主持通过 ApplicationHost.CreateApplicationHost 方法ASP.NET运行时。当我修改的web.config 的应用程序运行时,我看到很多的第一次机会 ThreadAbortException 取值抛出。这是对之前我的应用程序自带轰然倒下。我假设这是因为运行时检测更改配置,并希望重新启动。

I'm hosting the ASP.NET runtime via the ApplicationHost.CreateApplicationHost method. When I modify the web.config while the application is running, i see lots of first chance ThreadAbortExceptions thrown. This is right before my application comes crashing down. I'm assuming this is because the runtime has detected changes to the configuration and wants to restart.

这是不是真的对我们支持的方案,所以我preFER如果我能关掉自动重新加载。

This isn't really a supported scenario for us, so i'd prefer if I could just switch off the automatic reloading.

有谁知道如何做到这一点?

Does anyone know how to do this?

推荐答案

据我所知是没有办法禁用此行为,更改webconfig强制重新启动应用程序。

As far as I am aware there is no way to disable this behavior, changes to the webconfig force the application to be restarted.

有一个类似的问题这里只是为其他参考的。

编辑:发现其他信息可能会有所帮助。

Found additional info that may be helpful.

配置更改导致重新启动
  应用程序域
的结果
  更改
  在Web.config配置设置
  文件间接导致的应用程序
  域重新启动。这种行为
  设计出现。您可以选择
  使用configSource属性
  引用外部配置文件
  不会导致重新启动时
  更改。了解更多信息,
  看到configSource在一般属性
  节元素继承。

这MSDN文章

这篇关于如何prevent ASP.NET应用程序重新启动时,web.config中被修改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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