How to migrate from CMAB to the System.Configuration in .NET 2.0?

Is it possible using the new classes in .NET 2.0 in the System.Configuration namespace to have a config section like the following:

<editor>

     <font>Verdana</font>

     <size>24</size>

     <style>2</style>

</editor>

I am able to make it work with values being attributes, however my 1.1 applications are not that way.

Also, is it possible using the configSource attribute to have multiple config section in the same external file

Any help would be greatly appreciatted.

James



Answer this question

How to migrate from CMAB to the System.Configuration in .NET 2.0?

  • Oaktreewood

    I can't find a way to use elements instead of attributes in a custom section with .NET 2.0. since IConfigurationSectionHandler has been deprecated.

    Anyone knows how to do it as the original poster asks , if not why is this not supported

  • Mary Sun

    You could have any xml as your configuration data so far you have custom custom implementation of IConfigurationSectionHandler that could convert your xml into specific configuration object.

  • Don.Frazier

    Agreed, that is the way you would do it in .NET 1.1; however, in .NET 2.0 the IConfigurationSectionHandler has been deprecated. Is there a way to do it now .NET 2.0
  • kavitha_mx

    IConfigurationSectionHandler should still be supported, but the new way to build custom section handler in 2.0 is by extending the ConfigurationSection type.
  • How to migrate from CMAB to the System.Configuration in .NET 2.0?