问题描述
我正在开发一个asp.net项目,但是我还没有很长的web.config文件(超过400行).但是有了这个nhibernate log4net和urlrewrites.它越来越大.有没有适当的方法将web.config分为几部分.就像课程urlrewrite.config的nhibernate.config和log4net.config
I am developing a asp.net project and I dont have very long web.config file yet(more then 400 lines). but with this nhibernate log4net and urlrewrites. its getting bigger and bigger. is there a proper way to divide web.config into pieces. like nhibernate.config and log4net.config ofcourse urlrewrite.config
推荐答案
system.webServer
是配置部分 group -您无法对其进行外部化.
system.webServer
is a configuration section group - you cannot externalize that.
您只能将configSource =放在配置的部分-例如
You can only put the configSource= on a configuration section - e.g.
<system.webServer>
<validation configSource="validation.config"/>
<modules configSource="modules.config" />
<handlers configSource="handlers.config" />
</system.webServer>
什么是配置节组或常规配置节只能通过查看有关这些内容的文档来确定(即使那样,通常很难弄清它是节还是节组:-()
What is a configuration section group or a regular configuration section can only be determined by looking at the documentation for those things (and even then it's often not very easy to figure out whether it's a section or a section group :-( ).
这篇关于分割web.config的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!