migrate Configuration Management Application Block .net1.1 to system.configuration

503 Views Asked by At

I have to migrate a large .net 1.1 application to .net 3.5.

The system used Configuration Management Application Block (CMAB) to load config files starting with the app.config file as:

<configuration>
<configSections>
    <section 
        name="applicationConfigurationManagement" 
        type="Microsoft.ApplicationBlocks.ConfigurationManagement.ConfigurationManagerSectionHandler,Microsoft.ApplicationBlocks.ConfigurationManagement, Version=1.0.0.0,Culture=neutral,PublicKeyToken=e64cb664730084d3" />
    <section
        name="MyAppSystemSettings"
        type="Microsoft.ApplicationBlocks.ConfigurationManagement.XmlHashtableSectionHandler,Microsoft.ApplicationBlocks.ConfigurationManagement, Version=1.0.0.0,Culture=neutral,PublicKeyToken=e64cb664730084d3" />
</configSections>

<appSettings>
    <!-- Key / Value Pairs -->
</appSettings>

<!-- ##   Configuration Management Settings   ## -->
<applicationConfigurationManagement defaultSection="MyAppSystemSettings">
    <configSection name="MyAppSystemSettings">
        <configCache enabled="true" refresh="* 6 * * *" />
        <configProvider 
            assembly="Microsoft.ApplicationBlocks.ConfigurationManagement, Version=1.0.0.0,Culture=neutral,PublicKeyToken=e64cb664730084d3" 
            type="Microsoft.ApplicationBlocks.ConfigurationManagement.Storage.XmlFileStorage"
            signed="false" 
            refreshOnChange="false" 
            encrypted="false" 
            path="C:\Program Files\MyApp\Config\MyAppSystemSettings.Config" />
    </configSection>
</applicationConfigurationManagement>
</configuration>

As can be seen this is referencing the MyAppSystemSettings.Config 'sub' config file which looks like:

<configuration>
<MyAppSystemSettings>
    <XmlSerializableHashtable xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <Entries>
        <Entry>
          <key xsi:type="xsd:string">Key0</key>
          <value xsi:type="xsd:string">Value0</value>
        </Entry>
        <Entry>
          <key xsi:type="xsd:string">Key1</key>
          <value xsi:type="xsd:string">Value1</value>
        </Entry>
        <Entry>
          <key xsi:type="xsd:string">ExtraConfigFile</key>
          <value xsi:type="xsd:string">C:\Program Files\MyApp\Config\ExtraConfig.xml</value>
        </Entry>
     </XmlSerializableHashtable>
  </MyAppSystemSettings>
</configuration>

Considering that the app.config file refers to 10+ 'sub' config files similar to MyAppSystemSettings.Config and that they each contain 100+ entries I'm looking for the simplest way to migrate them to use System.Configuration correctly to give me the same results as the .net 1.1 solution using CMAB?

0

There are 0 best solutions below