I'm trying to use Enterprise Library Configuration Merge feature, but it doesn't see开发者_JS百科m 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.
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.
精彩评论