Split configuration file into multiple files

强颜欢笑 提交于 2020-03-20 10:01:10

We have three ways to split a large configuration file into multiple small configuration files. Here is the introductions.

  1. <linkedConfiguration>
    The main limitation of this way is the <linkedConfiguration> element is not supported for applications with Windows side-by-side manifests. We can refer to MSDN to get more information.
  2. System.Configuration.ConfigurationManager or System.Web.Configuration.WebConfigurationManager
    The main defect is we must design an architecture by ourself for supporting this. We can refer to MSDN to get more information.
  3. Using configSource
    Base on my understanding, this is the best way, we can avoid the previous two defects by the way. Here is my example. I use Unity Application Block of Microsoft Enterpriese Library in the example; I separated unity configuration file into another file under a sub folder.
    Code
    Web.config (Partial)
    Unity.config
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!