How to consolidate config files in an asp.net solution?
I have several projects and a website in a large asp.net solution. In some projects I have an app.config file and on a website I have my web.config. In each configuration, I specify a few things that are common among them, such as connection strings. Is there a way to combine these common elements into a single config file and specify which of the various projects that need them?
source to share
You can link to external config files in any .config (see http://www.peterprovost.org/blog/post/External-Config-Files-in-NET.aspx ).
Each project has a configuration file; these files are published in the bin directory as [output name] .config (for example, MyCode.DLL, MyCode.DLL.config). Then you can reference these .config files from your main config (web.config).
If you find that your config files are not finding the path to the correct destination, you can take the message compilation step mentioned by ChanChan.
source to share