*I am having 2 web.config one in root and another in subfolder.If i change any thing in the config file at sub folder,will the same will be updated automatically in rootfolder config file once i run the application?
*If i specify same connectionstring/keys in both config files at root & subfolder.When we execute the application,which connection string/key values will be taken for execution,will it root folder or subfolder?
*Is there any exception will throw if i have same key name values in multiple config values?
I am having 2 web.config one in root and another in subfolder.If i change any thing in the config file at sub folder,will the same will be updated automatically in rootfolder config file once i run the application?
For this requirement, you could use file attribute.
Create a config file in a new folder (E.g. appSettings.config)
After that the root web.config file will load the extra file (Override the by the key)
ssramvinay.83
If i specify same connectionstring/keys in both config files at root & subfolder.When we execute the application,which connection string/key values will be taken for execution,will it root folder or subfolder?
If the request page is in the subfolder, it will use the subfolder web.config file data if it has.
If the request page is in the rootfolder, it will use the root folder’s web.config file.
ssramvinay.83
Is there any exception will throw if i have same key name values in multiple config values?
No, just override.
ssramvinay.83
Which scenario we go for multiple config file?
For example: different setting in subfolder’s page.
Thanks
Best Regards
We are trying to better understand customer views on social support experience. Click HERE to participate the survey. Thanks!
Member
43 Points
68 Posts
Multiple Web.Config
Jul 15, 2014 11:55 PM|ssramvinay.83|LINK
I have few questions below.
*I am having 2 web.config one in root and another in subfolder.If i change any thing in the config file at sub folder,will the same will be updated automatically in rootfolder config file once i run the application?
*If i specify same connectionstring/keys in both config files at root & subfolder.When we execute the application,which connection string/key values will be taken for execution,will it root folder or subfolder?
*Is there any exception will throw if i have same key name values in multiple config values?
*Which scenario we go for multiple config file?
All-Star
52503 Points
15665 Posts
Re: Multiple Web.Config
Jul 16, 2014 12:06 AM|oned_gk|LINK
http://msdn.microsoft.com/en-us/library/vstudio/ms178685(v=vs.100).aspx
Suwandi - Non Graduate Programmer
All-Star
23975 Points
4084 Posts
Re: Multiple Web.Config
Jul 17, 2014 01:10 AM|Starain chen - MSFT|LINK
Hi ssramvinay,
First, please refer to oned_gk’s reply.
For this requirement, you could use file attribute.
After that the root web.config file will load the extra file (Override the by the key)
If the request page is in the subfolder, it will use the subfolder web.config file data if it has.
If the request page is in the rootfolder, it will use the root folder’s web.config file.
No, just override.
For example: different setting in subfolder’s page.
Thanks
Best Regards