Skip to main content
1 of 2

Add the following line after webApp.WebConfigModifications.Add(modification);

webApp.WebConfigModifications.Clear();

it clears all the non-required modifications from the object.