Helper class to add, clean, remove WebConfig modifications programmatically
 /// <summary>
 /// The feature activated.
 /// </summary>
 /// <param name="properties">
 /// The properties.
 /// </param>
 public override void FeatureActivated(SPFeatureReceiverProperties properties)
 {
     var webConfigModificationHelper = new WebConfigModificationHelper();
     var parent = properties.Feature.Parent as SPWebApplication;
     if (parent != null)
     {
         // Apply Web.config modifications
         webConfigModificationHelper.AddAndCleanWebConfigModification(
             parent,
             new Collection<SPWebConfigModification>()
             {
                 this.AutofacRequestHttpModuleWebConfigModification
             });
     }
 }
 /// <summary>
 /// The feature deactivating.
 /// </summary>
 /// <param name="properties">
 /// The properties.
 /// </param>
 public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
 {
     var webConfigModificationHelper = new WebConfigModificationHelper();
     var parent = properties.Feature.Parent as SPWebApplication;
     if (parent != null)
     {
         // Remove any changes by owner
         webConfigModificationHelper.RemoveExistingModificationsFromOwner(
             parent,
             RequestLifetimeWebConfigModificationOwner);
     }
 }