SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 1 down vote accepted

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

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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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