12
Vote

3.5 Config - Reactivation issue, pages node.

description

The 3.5 Config feature on first activation activates OK, deactivation of the feature deactivates OK, BUT if then it is reactivated for a second time there is an error:
 
Failed to apply a web.config modification to file 'configuration/system.web/pages'. The specified node "C:\Inetpub\wwwroot\wss\VirtualDirectories\80\web.config" was not found in the web.config file.
 
 
The Pages node is completely removed from the web.config on deactivation. This is one issue but there is a further issue.
 
 
Original config
 
<pages enableSessionState="false" enableViewState="true" enableViewStateMac="true" validateRequest="false" pageParserFilterType="Microsoft.SharePoint.ApplicationRuntime.SPPageParserFilter, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" asyncTimeout="7">
  <namespaces>
    <remove namespace="System.Web.UI.WebControls.WebParts" />
  </namespaces>
  <tagMapping>
    <add tagType="System.Web.UI.WebControls.SqlDataSource, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" mappedTagType="Microsoft.SharePoint.WebControls.SPSqlDataSource, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
  </tagMapping>
</pages>
 
 
After first activation
 
<pages enableSessionState="false" enableViewState="true" enableViewStateMac="true" validateRequest="false" pageParserFilterType="Microsoft.SharePoint.ApplicationRuntime.SPPageParserFilter, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" asyncTimeout="7">
  <namespaces>
    <remove namespace="System.Web.UI.WebControls.WebParts" />
  </namespaces>
  <tagMapping>
    <add tagType="System.Web.UI.WebControls.SqlDataSource, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" mappedTagType="Microsoft.SharePoint.WebControls.SPSqlDataSource, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
  </tagMapping>
  <controls>
    <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
  </controls>
</pages>
 
 
On deactivation the Pages node is removed. This means a second reactivation fails with the error above but a further issue is that the original nodes within the Pages node are now lost.

comments

PrinceCharles23 wrote Sep 18, 2008 at 1:33 PM

Same problem with Ajax.Config and afaik a problem with every mutually used (read: has possible subsections added by other projects) section that is added via WebConfigModifier.AddNodeValue (i.e.: SPWebConfigModificationType = EnsureChildNode)

with SPWebConfigModificationType = EnsureSection one can add such sections but then it's not possible to ceate nodes with attributes.

is there any known workaround/solution?

wrote Sep 18, 2008 at 1:33 PM

wrote Oct 2, 2008 at 2:53 PM

nbm400 wrote Oct 2, 2008 at 2:58 PM

Same problem here... to make matters worse, once the problem is introduced any future calls to app.Farm.Services.GetValue<SPWebService>().ApplyWebConfigModifications(); return the same error.

wrote Oct 31, 2008 at 6:33 PM

wrote Nov 8, 2008 at 5:14 PM

wrote Dec 22, 2008 at 11:15 AM

tns wrote Dec 22, 2008 at 11:16 AM

Anyone found a solution/workaround for this?

bikoenig wrote Jan 30, 2009 at 10:15 PM

this is absolute bullshit. is there no way to fix a MOSS site once you've b0rked it?

joshc wrote Apr 8, 2009 at 11:30 PM

For me it seemed to be initiated when we had 2 WFE and the timer service wasn't running on one when the WSP package was installed and feature activated. I assumed something got out of sync but I feel your pain, I never came up with a solution and its still an outstanding issue right now.

wrote Apr 16, 2009 at 2:55 AM

danwoodard wrote Apr 16, 2009 at 2:56 AM

This causes major problems in a multi-server farm it makes it impossible to add WFE's to the farm due to the corrupted web.config.

wrote May 6, 2009 at 2:24 PM

wrote Aug 4, 2009 at 11:56 AM

wrote Nov 5, 2009 at 1:12 PM

wrote Apr 9, 2010 at 6:06 AM

Mr_T wrote Apr 9, 2010 at 6:06 AM

same prob here

wrote May 11, 2010 at 8:25 AM

wrote Feb 14, 2013 at 7:55 PM