Harun
Harun

Reputation: 5179

How to retrieve items as a collection from a custom configuration section of an app.config file?

I have a custom configuration section defined in my app.config file. I need to get the tags and the sub tags within the created custom configuration section as a collection.

My config section is as follows,

      <configSections>
             <section name="myServices" type="NameSpace.ClassName, AssemblyName" />
        </configSections>
       <myServices>
           <Tag1>
              <subTag1 value="1"/>
              <subTag2 value="2"/>
           </Tag1>
           <Tag2>
              <subTag1 value="3"/>
              <subTag2 value="4"/>
           </Tag2>
       </myServices>

My requirement is to get subtag values under each Tag as a collection.

Please help me to sort this out if any one gone through this before..

Upvotes: 0

Views: 720

Answers (1)

Related Questions