Search code examples
.netconfigurationsection

Does there exist any tool to generate strongly-typed classes for .Net configuration?


I'm looking for a tool to generate strongly-typed classes from XML. I would like to define XML configuration (section, ConfigurationElements etc.) and then generate classes that could handle my configuration through ConfigurationManager.


Solution

  • Take a look at .NET Configuration Code Generator. It uses a sample of the desired XML to infer the configuration structure and types and generate the code.