2
Vote

WebConfigModifications not persisted

description

fmorisso submitted this change in your discussion list, but I wanted to bring it to your attention since it has not yet made it into the code base:
 
http://spwcfsupport.codeplex.com/Thread/View.aspx?ThreadId=78339
 
   public override void FeatureActivated(SPFeatureReceiverProperties properties)
    {
        SPWebApplication webApp = properties.Feature.Parent as SPWebApplication;
        if (webApp != null)
        {
            RemoveModifications(webApp);
            AddModifications(webApp);                
            SPFarm.Local.Services.GetValue<SPWebService>().ApplyWebConfigModifications();
            webApp.Update(); // This line need to be added in order for the modifications to be correctly propagated
        }
    }
 
 
The webApp.Update() method call needs to be added to the Deactivate method as well.
 
I have tested the original code in a multi-wweb front end environment and the web.config changes would not propagate to the app server, and web front ends.
 
After applying the previously mentioned changes, the web config changes are properly added and removed when activating and deactivating the feature.
 
Thanks for the hard work on this project!
 
Everett

file attachments

comments

redoz wrote Nov 4, 2010 at 9:09 AM

I've attached a patch that works against the latest source

wrote Feb 13, 2013 at 3:24 AM