You can have multiple configuration files in your project at the same level too. We do it like this. We have one main configuration file (Web.Config
), then we have two more configurations files. App.Config
and Database.Config
. in App.Config
we defined all the application level settings. in Database.Config
we define all the database level settings. And in Web.Config
we refer App.Config and Database.Config like this:
<appSettings configSource="app.config">
</appSettings>
<connectionStrings configSource="database.config">
</connectionStrings>
Also , you can have multiple web.config files in sub directories. Settings will be override automatically by asp.net.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…