Problems with ConfigurationManagement ApplicationBlock

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top