App domain restarts when .resx file changes. Any way to avoid this?

喜欢而已 提交于 2019-11-30 15:52:52

There are several flavors of this question on Stackoverflow; to repeat the answer, yes, it's definitely possible.

Like much of .NET, resource providers are extendable.

I would argue that the built-in resource providers (that compile .resx to .resources) are an unfortunate mismatch for web-centric deployments.

If your settings are primarily strings, you can plug in a simple UpdatableResXResourceProvider that uses the built-in ResXResourceReader to read from existing *.resx files.

The results are cached in the application cache.

No assemblies are generated – updates are immediately read just as they would be with any other file-based CacheDependency – any number of updates can be applied at run-time.

The only caveat is that if you don’t want to disable built-in FCNs, you have to move the *.resx files to the shielded App_Data folder (trivially done with a post-build step).

You can download the UpdatableResXResourceProvider here: http://www.onpreinit.com/2009/06/updatable-aspnet-resx-resource-provider.html

This blog post should help you out. I suspect its this:

The number of re-compilations (aspx, ascx or asax) exceeds the limit specified by the setting in machine.config or web.config (by default this is set to 15)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!