Click here to Skip to main content
15,888,461 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to use 2 config files in an asp.net project (one for main configuration and other for validation).
Please tell me how to use 2 files in project?
Thanks.
Posted
Updated 5-Jan-10 9:32am
v2

You can use as many config files as you want. But there can be one and only one web.config file.

By the way, what kind of configuration and validations do you want to have?

The simplest way would be to create the config file(any xml structure you want) and read it as a XmlDocument.
 
Share this answer
 
Web.config should be only one for each virtual directory. Even if you place multiple web.config in one folder, ConfigurationManager will only parse the file Web.config. Others you need to read it manually.

Other than that, you can place 1 web.config in each folder you create in the web application and the web server will only parse the local web.config(If not found it goes for the parent).

Therefore, if you have a folder abcd which have its own web.config file, it wouldnt go to parse the base web.config for calls made for forms inside that virtual directory.

:)
 
Share this answer
 

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