Click here to Skip to main content
15,877,967 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I Search about put two webconfig file,one for setting and the other for large amount of key/value with frequently change.the result was it difficult to organise the separation between development (which needs one set of web.config settings) and production (which needs different ones) an put key/value in database.what is proposed instead?

Similar discussion just took place in webconfig file in and change frequently[^].

In brief for large amounts of data and not related to actually configuring the server => I'd prefer database. Development and production would use separate databases so you can copy, modify and remove configuration items in both databases independently.
Share this answer
NewWebDesigner 12-Jul-15 4:20am    
thanks.but i have one database for all.two web-config:one for connectionstring and other setting the other one for things that if change them dont need restart all app.what is proposed?
Wendelius 12-Jul-15 4:27am    
I'm not sure if I understand you correctly. By placing the key/value data into a database, XML file, or similar lets you control when you re-read the data and when you don't. This sounds like you're reading the data only when the app starts thus causing the need to restart the application.
NewWebDesigner 12-Jul-15 4:36am    
ok,but if i put key/value in other webconfig,is there any setting for when app restart and when dont restart as while i change webconfig?
Use app.config file key/value information
Share this answer
NewWebDesigner 12-Jul-15 7:45am    
your idea is?use two web.config file?
Uzzal Kanti Barua 12-Jul-15 23:19pm    
app.config & web.config file
NewWebDesigner 13-Jul-15 6:05am    
ok,thats i use configsource or file?what is the difference?
if i put one in folder how can i set path and ExternalChange attribute?can you explain it?
Use web.config file for connection string & other related configuration.
Use app.config file for key-value pairs. For frequently changes elements keep in app.config file. So that you don't have change in web.config again & again.
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