Click here to Skip to main content
15,314,303 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How many web.config files can be allowed to use in an application?

One per folder, I think there is no limit beside this.

Practically as the others said you can have only one web.config file per application, However logically the values for the web.config files you can pick it up from 4 other files apart from the web.config file as listed below

1) machine config file (C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG)

2) web.config file ( C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG)

3) application host file( C:\Windows\System32\inetsrv)

4) web config file at site level

I hope this helps!.

Comments 18-Aug-10 7:47am
Reason for my vote of 5
Good pointers
There can be only one web.config file in the root directory. Sub-directories within the web application can contain their own web.config files to control individual configuration settings appropriate to the given sub-directory.

Reference: Wikipedia - Web.Config[^]
MSDN - Web.Config[^]

You could have got them as the first two results if you would have Googled[^]
mohini1796 17-Aug-10 7:24am
Thanks a lot
Ankur\m/ 17-Aug-10 7:28am
Most welcome!
And please remember to do a search before you ask. In most cases you will find the solution without bothering anyone. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900