[英]Consolidating Web.config Files
By default, ASP.NET splits up your web.config so that razor-related items are included in "~/views/web.config" while everything else is put into "~/web.config". 默认情况下,ASP.NET拆分您的web.config,以便将与剃须刀相关的项目包含在“〜/ views / web.config”中,而其他所有内容都放入“〜/ web.config”中。
For me, it would make sense to combine all of it into one so that it would apply to the entire site. 对我而言,将所有内容组合为一个整体是有意义的,以便将其应用于整个网站。 Would there be any downside to doing this?
这样做会有不利之处吗?
As you've seen it's valid to have multiple web.config
files in a website, under different folders. 如您所见,在网站的不同文件夹下具有多个
web.config
文件是有效的。
In your main web.config
(at the site root), you can specify different configuration at different folders in the site using the <location>
element. 在主
web.config
(位于站点根目录)中,可以使用<location>
元素在站点的不同文件夹中指定不同的配置。 Having a web.config
file in that folder (location) instead has the same effect, so consolidation is possible. 相反,在该文件夹(位置)中有一个
web.config
文件具有相同的效果,因此可以进行合并。
However, I would suggest leaving it be: 但是,我建议将其保留为:
web.config
there. web.config
。 There's bound to be other reasons too, but they come to mind right now. 当然也有其他原因,但是现在就想到了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.