Thanks for Bryan's input.
Hi Hk,
As for the projects you're currently dealing with, are they developing upon
..net framework 1.1/ vs2003 or .net framework 2.0/vs 2005. In .net framework
2.0, the new configuration system has provide the support of linking an
external file for individual configuration section in the application
config file (app.config or web.config).
#Managing Changes to Configuration Settings
http://msdn2.microsoft.com/en-us/library/ms228058.aspx #Configuration & ASP.NET 2.0
http://odetocode.com/Blogs/scott/archive/2005/07/04/1906.aspx The above reference has demonstrate its usage in asp.net application.
However, it also applies for most built-in configuration sections (such as
configuration Section under <system.net> , <system.diagnostics> .....).
For example, your main app.config can look like below:
======================
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings configSource="appSettings.config"></appSettings>
<connectionStrings configSource="connectionStrings.config" />
<system.diagnostics
configSource="system.diagnostics.config"></system.diagnostics>
<system.net>
<settings configSource="system.net_settings.config"></settings>
</system.net>
</configuration>
====================
The detailed settings of each section is defined in the external config
file. e.g.
=========appSettings.config==============
<?xml version="1.0" encoding="utf-8" ?>
<appSettings>
<add key="key1" value="value1"/>
<add key="key2" value="value2"/>
</appSettings>
=========================
So far I haven't found any built-in add-in that can help automatically do
this or merging separate files together. We need to do such separate
configuration ourselves.
In addition, if you're using ASP.NET 2.0, there is a add-on project called
"Web Deployment Project". This add-on project can help us do customized web
application precompilation, and one of the feature in it is let us specify
configuration section replacement at the precompile time. You can have a
look at the following article which has demonstrate the configuration
section replacement:
#VS 2005 Web Deployment Projects
http://weblogs.asp.net/scottgu/archive/2005/11/06/429723.aspx Hope this helps some though it seems still far from perfect. If there is
any other questions on this, please feel free to post here.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx. ==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.