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

      <childnodes />
      <childnodes />

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


Does anyone know what I'm doing wrong?

1 Answer 1


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


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'..

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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