Click here to Skip to main content
15,886,035 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

Yesterday i was just trying to use multiple webconfig files.
And i succeeded on how multiple webconfig files can be programed.

Now my confusion is why to use multiple webconfig files?

Valid answers are appreciated.

Thanx in advance.
Posted

1 solution

You can work with more then one web.config file in asp.net. But you can not put more then one web.config in each folder. Let’s first understand the hierarchy of web.config and other configuration file settings. On the top of the every configuration files you will have machine.config file which will have all system wide configuration settings.You can find this file in your OS drive like C:/windows/Microsoft.NET/vFrameworkNumber/Config folder. Here framework number with what ever framework you are using 1.1/2.0/3.5 or 4.0. You can override those settings in web.config file at the your application root folder. Same way you can add more web.config file in subfolder and can override the setting of parent folder web.config file.
 
Share this answer
 
Comments
JV9999 28-Jun-11 8:28am    
That's actually incorrect Toniyo. You can use multiple web.config's in 1 project per folder in ASP.NET. BUT (big but) this only works in VS2010 (if I remember) and it's only allowed if you have 1 web.config for each build-mode (debug, release etc..) and in those cases they should be named: Web.debug.config and Web.Release.config for example. See http://blogs.msdn.com/b/webdevtools/archive/2009/05/04/web-deployment-web-config-transformation.aspx for more info on this.
Muthu Nadar 29-Jun-11 3:54am    
Thanx for your reply guys.
I agree with both of ur points, actually i got my answer from Mr.Toniyo, what he said is correct, as i practically tested it.
And JV9999 u r also right, but you went too depth.
Thanx guys
Toniyo Jackson 29-Jun-11 3:58am    
Accept and vote the answer, if its helped you!!!
Muthu Nadar 2-Jul-11 1:45am    
Sure buddy...

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