Yes, but I can have the app configs defined like this: <!-- Dll1.extra.config --> <appSettings> <add key="key1" value="value1"/> </appSettings>
<!-- Dll2.extra.config --> <appSettings file="Dll1.extra.config"> <add key="key2" value="value2"/> </appSettings> and <!-- App.exe.config --> <appSettings file="Dll2.extra.config"> <add key="key3" value="value3"/> </appSettings> Can't I? I don't think there is a limitation on how many "includes" you have in you "appSettings" section. Then, inside my application I would have access to all three keys: key1 : value1 from Dll1.extra.config key2 : value2 from Dll2.extra.config key3 : value3 from App.exe.config I better test this before it goes any further. Thanks, Eddie -----Original Message----- From: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] Behalf Of Mike Woodring Sent: Tuesday, December 13, 2005 2:31 PM To: [email protected] Subject: Re: [ADVANCED-DOTNET] Linking app.config files > I can read the configuration from app.exe.config file, but I > need to be able > to read the configuration from all three config files. > I remember reading a while ago about the possibility to > link/chain/refer > multiple config files together, but I cannot find that > resource/article > anymore. The <appSettings> element supports a file attribute. Just bring up MSDN and type "<appSettings" into the index. But since you've got 3 files, it's not quite going to work for you. If you only needed to read 2 files, it works something like this... Your main app.config file could have an <appSettings> section that looks like so: <appSettings file="extra.config"> <add key="key1" value="key1 from app.config"/> <add key="key2" value="key2 from app.config"/> </appSettings> Then extra.config would have *only* an appSettings element as its root element that looks like this: <appSettings> <add key="key2" value="key2 from extra.config"/> <add key="key3" value="key3 from extra.config"/> </appSettings> When app settings are read, the linked file takes precedence. Keys not found there are pulled from the 'root'/main app.config file. So given the above files, here's what ConfigurationSettings.AppSettings[] would return for each key: key1 : key1 from app.config (not found in extra.config) key2 : key2 from extra.config (extra.config overrides app.config) key3 : key3 from extra.config (not found in app.config) Since you're working with 3 config files, some alternatives would be to just use the builtin <appSettings> reader in the .NET class library to read an arbitrary config file[1], or to use a variation that models per-dll configuration files[2]. -Mike Bear Canyon Consulting LLC http://www.bearcanyon.com http://www.pluralsight.com/mike [1] http://www.bearcanyon.com/dotnet/#ConfigFileReader [2] http://www.bearcanyon.com/dotnet/#AssemblySettings =================================== This list is hosted by DevelopMentor. http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com
