One application can have only one Web config file - true or false

Editorial / Best Answer

Answered by: Harit Pandya

  • Oct 10th, 2006


An asp.net application is a virtual directory that you make on a web server. This application will take the settings of machine.config file if a web.config file is not available in that directory. Now if you create a sub directory inside a virtual directory and place another web.config file in the sub directory then the sub directory will take the settings of the web.config file in that particular directory.

So my answer is that an application can have more than one web.config file but they should be in different directories of that web application and also the sub directory that uses it should be a virtual directory

Showing Answers 1 - 23 of 23 Answers

Pronobesh

  • Sep 27th, 2006
 

This statement is partially true,if you have more than one page you can create more than one web.config file.It's up to you.

  Was this answer useful?  Yes

balachandar

  • Oct 4th, 2006
 

Its true,one application have only one web.config file

Harit Pandya

  • Oct 10th, 2006
 

An asp.net application is a virtual directory that you make on a web server. This application will take the settings of machine.config file if a web.config file is not available in that directory. Now if you create a sub directory inside a virtual directory and place another web.config file in the sub directory then the sub directory will take the settings of the web.config file in that particular directory.

So my answer is that an application can have more than one web.config file but they should be in different directories of that web application and also the sub directory that uses it should be a virtual directory

Ali

  • Dec 25th, 2006
 

Depends, But YES

  Was this answer useful?  Yes

lalitha1024

  • Feb 14th, 2008
 

Depends.... but answer is false because we can have more than one web.config files for an application. web.config file is unqiue for folder. one application can contain many folders, so one application can contain many web.config files.

  Was this answer useful?  Yes

ghanidhar

  • Mar 5th, 2008
 

Actually it is False.If your web application has a well defined folder structure you can have as many web.configs as that of your folder structure.Lets Say For Example The Admin Folder in the application Can contain a web.config with all settings for the admin Role. If you have members you can have members folders with all the settings related to Members in another web.config

arora_simi

  • Jun 29th, 2009
 

We can use more than one web.config file to meet the different security and other configuration requirements of different directories, and in any case web.config file of subdirectory will take the precedence over file of root directory.

  Was this answer useful?  Yes

sandeep verma

  • Nov 14th, 2011
 

Anther Web config file also exist but in a website if they are in different folder.

  Was this answer useful?  Yes

jat16may

  • Nov 19th, 2011
 

One application may have more than one file but root can hold one web.config and if the folder then we can keep each folder one web.config file........

  Was this answer useful?  Yes

Nilpesh Patel

  • Mar 30th, 2012
 

One application can have more than one WEB.config file but application root has only one. And any folder then we can add config file inside.

If we define same key in both config file then the config file inside the folder overrides the value of root config file.

  Was this answer useful?  Yes

Neeru Verma

  • Jun 4th, 2012
 

No, There can be only one Web.config file in a project. Although we can have multiple .config* configuration) files in a project.

  Was this answer useful?  Yes

jamil

  • Sep 7th, 2012
 

True

  Was this answer useful?  Yes

Jitender Sharma

  • Sep 21st, 2012
 

False,Yes... A Project can have multiple web.config files, but they resides in separate folders...

  Was this answer useful?  Yes

gowtham

  • May 8th, 2015
 

Question:
Is that the page should have an single web.config or the entire project have a single web.config

  Was this answer useful?  Yes

Pratul Tripathi

  • Sep 2nd, 2015
 

A project can have multiple web.config files, but at different levels. here different levels means at different folder or structure. In this case every page running uses the web.config file at its level/structure and if not found goes to its parent structure.

  Was this answer useful?  Yes

Shrikant B

  • May 18th, 2016
 

One project can have multiple Web.Config files.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions