We have a rather large CSLA app that has grown to the app itself and a dozen add on programs and utilities. They all use the same exact configuration file settings and currently we instruct users to copy the main applications config file and rename it to the utility or add-on program name depending on which one they purchased or are using.
This is ugly on it's own and particularly when they change their data source or something to say the least. I'm wondering if there is any reliable method to consolidate those configuration files into one single one "Global.config" or somethign that will work also with asp.net as well as winforms.
I noticed that the new ConfigurationManager class in .net 2.x seems to support opening other config files but I can't make heads or tails of it so far.
Any thoughts or ideas would be very welcome.
I usually create a Common.Config with database and other settings.
Then from the various App.Config I refer to this Common.Config, this way you can still use your standard code to retrieve AppSettings values. No additional code needed.
App.Config :
<appSettings file="..\Common.Config" />
Or
<appSettings file="..\Common.Config" >
<add key="MyPath" value="C:\" />
</appSettings
Common.Config :
<?xml version="1.0" encoding="utf-8" ?>
<appSettings>
<add key="DB:Security" value="....." />
</appSettings>
Hope this helps...
Jurjen.
Jurjen:I usually create a Common.Config with database and other settings.
Then from the various App.Config I refer to this Common.Config, this way you can still use your standard code to retrieve AppSettings values. No additional code needed.
That helps a *lot*! I didn't know you could do that.
I'll check that out, thank you very much for posting that.
Cheers!
Copyright (c) Marimer LLC