Reading ApplicationSettings from another assembly RRS feed

  • Question

  • I have an object which uses another, I want the first object to use the ApplicationSettings found in the second objects (a dll) app.config file, how can this be done.

    If it were the the object reading it's own .config file I could use implementation of System.Configuration.ApplicationSettingsBase but it's not.
    The calling object will only know the name of the name and path of the dll, hence I've been playing with
    System.Configuration.Configuration config = System.Configuration.ConfigurationManager.OpenExeConfiguration
    but this does not give me access to and ApplicationSettings Property (like appSettings does), how can I access the keys and values themselves?

    <?xml version="1.0" encoding="utf-8" ?>
    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
    <section name="Template.Project" type="System.Configuration.ClientSettingsSection, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    <setting name="Server" serializeAs="String">
    <setting name="loggingPath" serializeAs="String">
    Monday, December 4, 2006 4:58 PM