This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected void removeWebConfigEntries(SPWebApplication oWebApp, string owner) | |
{ | |
Collection<SPWebConfigModification> oCollection = oWebApp.WebConfigModifications; | |
int iStartCount = oCollection.Count; | |
for (int c = iStartCount - 1; c >= 0; c--) | |
{ | |
SPWebConfigModification oModification = oCollection[c]; | |
if (oModification.Owner == owner) | |
oCollection.Remove(oModification); | |
} | |
if (iStartCount > oCollection.Count) | |
{ | |
oWebApp.Update(); | |
SPFarm.Local.Services.GetValue<SPWebService>().ApplyWebConfigModifications(); | |
} | |
} |