0

I'm trying to use Enterprise Library Configuration Merge feature, but it doesn't seem to work.

I Have 3 projects: DLL1, EXE1 and EXE2.

The DLL project is using the Settings configuration style (ie. DLL1Namespace.Properties.Settings.Default) - it adds the configuration section in the "applicationSettings" sectionGroup.

ConfigSections:

<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  <section name="DLL1Namepsace.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</sectionGroup>

applicationSettings:

  <applicationSettings>
    <DLL1Namepsace.Properties.Settings>
      <setting name="Setting1" serializeAs="String">
        <value>Value1</value>
      </setting>
    <DLL1Namepsace.Properties.Settings>
  </applicationSettings>

What I'm trying to do is to have a shared config file for both of the EXE's that is holding the DLL application settings. Enterprise Library is supposed to have this feature but I can't find a way to configure it. I've tried parent sections, redirecting sections, etc.

Thank you.

Charles
  • 50,943
  • 13
  • 104
  • 142
Bogdan Maxim
  • 5,866
  • 3
  • 23
  • 34

1 Answers1

0

Updated 5/26/2011 This scenario of using the .NET Configuration API directly is not supported by EntLib. To benefit from the configuration extensions provided by EntLib (including merging and redirection), you must use EntLib’s configuration API.

The Configuration Sources Lab from the Enterprise Library Hands-On Lab Set illustrates that.

Grigori Melnik
  • 4,067
  • 2
  • 34
  • 40
  • Could you please post a working sample? The labs are just for enterprise library specific sections (at least this is the only thing that is working on my machine). – Bogdan Maxim May 23 '11 at 06:05
  • Bogdan, updated my answer. In your scenario, you cannot benefit from the merging and redirection features of EntLib. – Grigori Melnik May 26 '11 at 19:18