Dear Friend,
Your error says it all. Correct your code like this:-
<configuration>
<configsections>
<section name="Category" type="Hang.MyConfigSection" />
</configsections>
<startup>
<supportedruntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<category>
<add name="Animals" filepath="Animals.txt" />
<add name="Cities" filepath="Cities.txt" />
</category>
</configuration>
for reference:-
Visit (^)
configSections must be the first child of the root element:
This link will help you out:-
Access Custom Tag in app.config
Please mark it as your answer if it helps you out.
Regards
Varun Sareen