Problems with ConfigurationManagement ApplicationBlock

  • Thread starter Thread starter Tim Ryan
  • Start date Start date
T

Tim Ryan

I'm having trouble using the ConfigurationManagement Application Block.

app.config is the following:
<configuration >
<configSections>
<section name="applicationConfigurationManagement"
type="Microsoft.ApplicationBlocks.ConfigurationManagement.ConfigurationManagerSectionHandler,Microsoft.ApplicationBlocks.ConfigurationManagement"
/>
<section name="appSettings"
type="Microsoft.ApplicationBlocks.ConfigurationManagement.XmlHashtableSectionHandler,Microsoft.ApplicationBlocks.ConfigurationManagement"
/>
</configSections>
<appSettings>
<ApplicationName>"Import"</ApplicationName>
</appSettings>
<applicationConfigurationManagement defaultSection="appSettings">
<configSection name="appSettings">
<configProvider
assembly="Microsoft.ApplicationBlocks.ConfigurationManagement"
type="Microsoft.ApplicationBlocks.ConfigurationManagement.Storage.XmlFileStorage"
signed="false" encrypted="false" />
</configSection>
</applicationConfigurationManagement>
</configuration>


When I try to do:
ConfigurationManager.Read("appSettings");

I get:
An unhandled exception of type
'System.Configuration.ConfigurationException' occurred in
microsoft.applicationblocks.configurationmanagement.dll

Additional information: Section or group name 'appSettings' already defined


If I comment out the
<section name="appSettings"
type="Microsoft.ApplicationBlocks.ConfigurationManagement.XmlHashtableSectionHandler,Microsoft.ApplicationBlocks.ConfigurationManagement"
/>

I get this exception
An unhandled exception of type
'System.Configuration.ConfigurationException' occurred in
microsoft.applicationblocks.configurationmanagement.dll

Additional information: Creating Storage Provider and Cache for section
'appSettings' where storage type =
'Microsoft.ApplicationBlocks.ConfigurationManagement.Storage.XmlFileStorage'
and assembly = 'Microsoft.ApplicationBlocks.ConfigurationManagement'



As far as I can tell, I'm doing it the same as the sample code. Any
help would be appreciated.

Thanks,
Tim
 
Back
Top