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".
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.
In your main web.config
(at the site root), you can specify different configuration at different folders in the site using the <location>
element. Having a web.config
file in that folder (location) instead has the same effect, so consolidation is possible.
However, I would suggest leaving it be:
web.config
there. There's bound to be other reasons too, but they come to mind right now.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.