I want to add a custom configuration section in my app.config file.
Is there a way to do it and how can I access these settings in my program.
Following is the config section I want to add to my app.config:
<RegisterCompanies>
<Companies>
<Company name="Tata Motors" code="Tata"/>
<Company name="Honda Motors" code="Honda"/>
</Companies>
</RegisterCompanies>
Import namespace :
Create ConfigurationElement Company :
ConfigurationElementCollection:
and ConfigurationSection:
and you must also register your new configuration section in web.config (app.config):
then you load your config with