Ajax.config - A web configuration modification operation is already running.

Feb 28, 2008 at 4:25 PM
Hi,
has anyone gotten this error message when trying to activate the Ajax.config.wsp feature:

A web configuration modification operation is already running.

This is what is to be found in the ULS log:

Feature receiver assembly 'AJAX.Config, Version=1.0.0.0, Culture=neutral, PublicKeyToken=fdea667324fa9a95', class 'AJAX.Config.FeatureReceiver', method 'FeatureActivated' for feature '9fefda92-e608-4e3a-a1bc-a2be9104b30b' threw an exception: System.InvalidOperationException: A web configuration modification operation is already running.
at Microsoft.SharePoint.Administration.SPWebService.ApplyWebConfigModifications()
at AJAX.Config.WebConfigModifier.SaveWebConfig(SPWebApplication application)
at AJAX.Config.FeatureReceiver.AddConfigurationToWebConfig(SPWebApplication app)
at AJAX.Config.WebConfigModifier.AddOrRemoveHandler(SPFeatureReceiverProperties properties, Boolean removeModification)
at AJAX.Config.WebConfigModifier.FeatureActivated(SPFeatureReceiverProperties properties)
at Microsoft.SharePoint.SPFeature.DoActivationCallout(Boolean fActivate, Boolean fForce)

Feature Activation: Threw an exception, attempting to roll back. Feature 'AJAX.Config' (ID: '9fefda92-e608-4e3a-a1bc-a2be9104b30b'). Exception: System.InvalidOperationException: A web configuration modification operation is already running.
at Microsoft.SharePoint.Administration.SPWebService.ApplyWebConfigModifications()
at AJAX.Config.WebConfigModifier.SaveWebConfig(SPWebApplication application)
at AJAX.Config.FeatureReceiver.AddConfigurationToWebConfig(SPWebApplication app)
at AJAX.Config.WebConfigModifier.AddOrRemoveHandler(SPFeatureReceiverProperties properties, Boolean removeModification)
at AJAX.Config.WebConfigModifier.FeatureActivated(SPFeatureReceiverProperties properties)
at Microsoft.SharePoint.SPFeature.DoActivationCallout(Boolean fActivate, Boolean fForce)
at Microsoft.SharePoint.SPFeature.Activate(SPSite siteParent, SPWeb webParent, SPFeaturePropertyCollection props, Boolean fForce)

Any ideas on how to solve this or pointers on what could be wrong?

Thanks,
Johan
Feb 28, 2008 at 5:03 PM
That's usually not good. I have seen that error when I have been playing around with web config modifcations and I have a bogus one in the collection. Have you done anything else with the API to edit the web config mods? Is it possible you have a bad entry in the collection?
Mar 12, 2008 at 1:01 PM
The issue is that the Ajax.Config feature handler calls the ApplyWebConfigModifications method multiple times. This is no issue for a Single Server installation, but it is an issue in a Server Farm with multilple FEW Servers. It's documented in Mark's post over here: http://www.crsw.com/mark/Lists/Posts/Post.aspx?ID=32.

I've created an entry in the Issue Tracker to keep track of this bug.
Mar 12, 2008 at 7:13 PM
Jan,
thanks for the information, that's just the kind of environment I'm getting this error on.
Is there a workaround for this (except for adding the entries manually...)?

Regards,
Johan
Mar 13, 2008 at 8:22 AM
I don't know any other WSP to configure AJAX. You could alter the source code and just leave the last ApplyWebConfigModifications method intact. I've done this but I haven't tested my code fully to make sure it works.

J