0

I'm using SPWebConfigModification to update web.config. I've got the following scenario:

<configuration>
  <configSection>
    <sectionGroup>
      <childnodes />
    </sectionGroup>     
    <sectionGroup>
      <childnodes />
    </sectionGroup>
  </configSection>
</configuration>

When I add a new <sectionGroup> it adds fine but when I add a childnode to it, the child node is adding to the first <sectionGroup> tag. I'm using

Xpath=configuration/configsection/sectionGroup

Does anyone know what I'm doing wrong?

1

As there are more then one sectionGroups in the Config..try

configuration/configsection/sectionGroup[index]

or you can select correct sectionGroup by giving name as given below.

configuration/configsection/sectionGroup[@name = 'microsoft.sharepoint.client']

above xPath will return the sectionGroup with name 'Microsoft.sharepoint.client'..

1
  • @sbtahir: Thanks for giving the answer, please mark it as the answer. Thanks :)
    – Alex Angas
    Aug 17 '10 at 5:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.