Thursday, April 17, 2014

Little trick regarding "SharePoint Server Publishing Infrastructure" and "save site as template"

In theory, if the site feature "SharePoint Server Publishing" is deactivated, we can save the site as a template, which can be used to generate other sites.

However, this is not true.

The problem is not about the site feature "SharePoint Server Publishing", but the site collection feature "SharePoint Server Publishing Infrastructure".

When "SharePoint Server Publishing Infrastructure" is activated, a lot of stuff are created; but, when it's deactivated, not all relevant content are removed completely.

I cannot find the explanation of that. During my test on SharePoint 2010 SP2 + CU201308, after reactivating "SharePoint Server Publishing Infrastructure", I got the error message below when clicking "Page layouts and site templates", or "save site as template", or enable site feature "SharePoint Server Publishing", or test the new site based on a generated site template.

In summary,

1. Don't deactivate site collection feature "SharePoint Server Publishing Infrastructure".


2. Don't save the site as a template if "SharePoint Server Publishing Infrastructure" is activated.

[update 20140424]

Please click here to see how to deactivate this feature properly.

==============

Unable to open Lookup list '{64D9347E-BCBC-471D-B038-4AED71833C6D}'.[Error was 0x81020026]


Event ListItem throws an argument exception on web url http://site1.sharepoint.local/sites/test1 and item id 170


Unable to open Lookup list '{64D9347E-BCBC-471D-B038-4AED71833C6D}'.[Error was 0x81020026]


Not enough information to determine a list for module "XSLStyleSheets". Assuming no list for this module.


Failed to instantiate file "ContentQueryMain.xsl" from module "XSLStyleSheets": The specified list does not exist.


The element of type 'Module' for feature 'PublishingResources' (id: aebc918d-b20f-4a11-a1db-9ed84d79c87e) threw an exception during activation: Failed to instantiate file "ContentQueryMain.xsl" from module "XSLStyleSheets": The specified list does not exist.

Feature Activation: Threw an exception, attempting to roll back.  Feature 'PublishingResources' (ID: 'aebc918d-b20f-4a11-a1db-9ed84d79c87e').  Exception: Microsoft.SharePoint.SPException: Failed to instantiate file "ContentQueryMain.xsl" from module "XSLStyleSheets": The specified list does not exist. ---> System.Runtime.InteropServices.COMException (0x81070588): Failed to instantiate file "ContentQueryMain.xsl" from module "XSLStyleSheets": The specified list does not exist.  
 at Microsoft.SharePoint.Library.SPRequestInternalClass.EnableModuleFromXml(String bstrSetupDirectory, String bstrFeatureDirectory, String bstrUrl, String bstrXML, Boolean fForceUnghost, ISPEnableModuleCallback pModuleContext)  
 at Microsoft.SharePoint.Library.SPRequest.EnableModuleFromXml(String bstrSetupDirectory, String bstrFeatureDirectory, String bstrUrl, String bstrXML, Boolean fForceUnghost, ISPEnableModuleCallback pModuleContext)     -
 -- End of inner exception stack trace ---  
 at Microsoft.SharePoint.Administration.SPElementDefinitionCollection.ProvisionModules(SPFeaturePropertyCollection props, SPSite site, SPWeb web, SPFeatureActivateFlags activateFlags, Boolean fForce)  
 at Microsoft.SharePoint.Administration.SPElementDefinitionCollection.ProvisionElements(SPFeaturePropertyCollection props, SPWebApplication webapp, SPSite site, SPWeb web, SPFeatureActivateFlags activateFlags, Boolean fForce)  
 at Microsoft.SharePoint.SPFeature.Activate(SPSite siteParent, SPWeb webParent, SPFeaturePropertyCollection props, SPFeatureActivateFlags activateFlags, Boolean fForce)


The feature 'f6924d36-2fa8-4f0b-b16d-06b7250180fa' depends on feature 'aebc918d-b20f-4a11-a1db-9ed84d79c87e' which failed to activate: Microsoft.SharePoint.SPException: Failed to instantiate file "ContentQueryMain.xsl" from module "XSLStyleSheets": The specified list does not exist. ---> System.Runtime.InteropServices.COMException (0x81070588): Failed to instantiate file "ContentQueryMain.xsl" from module "XSLStyleSheets": The specified list does not exist.  
 at Microsoft.SharePoint.Library.SPRequestInternalClass.EnableModuleFromXml(String bstrSetupDirectory, String bstrFeatureDirectory, String bstrUrl, String bstrXML, Boolean fForceUnghost, ISPEnableModuleCallback pModuleContext)  
 at Microsoft.SharePoint.Library.SPRequest.EnableModuleFromXml(String bstrSetupDirectory, String bstrFeatureDirectory, String bstrUrl, String bstrXML, Boolean fForceUnghost, ISPEnableModuleCallback pModuleContext)     -
 -- End of inner exception stack trace ---  
 at Microsoft.SharePoint.Administration.SPElementDefinitionCollection.ProvisionModules(SPFeaturePropertyCollection props, SPSite site, SPWeb web, SPFeatureActivateFlags activateFlags, Boolean fForce)  
 at Microsoft.SharePoint.Administration.SPElementDefinitionCollection.ProvisionElements(SPFeaturePropertyCollection props, SPWebApplication webapp, SPSite site, SPWeb web, SPFeatureActivateFlags activateFlags, Boolean fForce)  
 at Microsoft.SharePoint.SPFeature.Activate(SPSite siteParent, SPWeb webParent, SPFeaturePropertyCollection props, SPFeatureActivateFlags activateFlags, Boolean fForce)  
 at Microsoft.SharePoint.SPFeatureCollection.AddInternal(SPFeatureDefinition featdef, Version version, SPFeaturePropertyCollection properties, SPFeatureActivateFlags activateFlags, Boolean force, Boolean fMarkOnly)  
 at Microsoft.SharePoint.SPFeatureCollection.CheckSameScopeDependency(SPFeatureDefinition featdefDependant, SPFeatureDependency featdep, SPFeatureDefinition featdefDependency, Boolean fActivateHidden, Boolean fUpgrade, Boolean fForce, Boolean fMarkOnly)


Exception was thrown while ensuring dependencies met for feature 'PublishingSite' (id: f6924d36-2fa8-4f0b-b16d-06b7250180fa): Microsoft.SharePoint.SPException: Failed to instantiate file "ContentQueryMain.xsl" from module "XSLStyleSheets": The specified list does not exist. ---> System.Runtime.InteropServices.COMException (0x81070588): Failed to instantiate file "ContentQueryMain.xsl" from module "XSLStyleSheets": The specified list does not exist.  
 at Microsoft.SharePoint.Library.SPRequestInternalClass.EnableModuleFromXml(String bstrSetupDirectory, String bstrFeatureDirectory, String bstrUrl, String bstrXML, Boolean fForceUnghost, ISPEnableModuleCallback pModuleContext)  
 at Microsoft.SharePoint.Library.SPRequest.EnableModuleFromXml(String bstrSetupDirectory, String bstrFeatureDirectory, String bstrUrl, String bstrXML, Boolean fForceUnghost, ISPEnableModuleCallback pModuleContext)     -
 -- End of inner exception stack trace ---  
 at Microsoft.SharePoint.Administration.SPElementDefinitionCollection.ProvisionModules(SPFeaturePropertyCollection props, SPSite site, SPWeb web, SPFeatureActivateFlags activateFlags, Boolean fForce)  
 at Microsoft.SharePoint.Administration.SPElementDefinitionCollection.ProvisionElements(SPFeaturePropertyCollection props, SPWebApplication webapp, SPSite site, SPWeb web, SPFeatureActivateFlags activateFlags, Boolean fForce)  
 at Microsoft.SharePoint.SPFeature.Activate(SPSite siteParent, SPWeb webParent, SPFeaturePropertyCollection props, SPFeatureActivateFlags activateFlags, Boolean fForce)  
 at Microsoft.SharePoint.SPFeatureCollection.AddInternal(SPFeatureDefinition featdef, Version version, SPFeaturePropertyCollection properties, SPFeatureActivateFlags activateFlags, Boolean force, Boolean fMarkOnly)  
 at Microsoft.SharePoint.SPFeatureCollection.CheckSameScopeDependency(SPFeatureDefinition featdefDependant, SPFeatureDependency featdep, SPFeatureDefinition featdefDependency, Boolean fActivateHidden, Boolean fUpgrade, Boolean fForce, Boolean fMarkOnly)  
 at Microsoft.SharePoint.SPFeatureCollection.CheckFeatureDependency(SPFeatureDefinition featdefDependant, SPFeatureDependency featdep, Boolean fActivateHidden, Boolean fUpgrade, Boolean fForce, Boolean fMarkOnly, FailureReason& errType)  
 at Microsoft.SharePoint.SPFeatureCollection.CheckFeatureDependencies(SPFeatureDefinition featdef, Boolean fActivateHidden, Boolean fUpgrade, Boolean fForce, Boolean fThrowError, Boolean fMarkOnly, List`1& missingFeatures)


Feature Activation: Failed to ensure feature dependencies for feature 'PublishingSite' (id: 'f6924d36-2fa8-4f0b-b16d-06b7250180fa'), exception thrown: Microsoft.SharePoint.SPException: Failed to instantiate file "ContentQueryMain.xsl" from module "XSLStyleSheets": The specified list does not exist. ---> System.Runtime.InteropServices.COMException (0x81070588): Failed to instantiate file "ContentQueryMain.xsl" from module "XSLStyleSheets": The specified list does not exist.  
 at Microsoft.SharePoint.Library.SPRequestInternalClass.EnableModuleFromXml(String bstrSetupDirectory, String bstrFeatureDirectory, String bstrUrl, String bstrXML, Boolean fForceUnghost, ISPEnableModuleCallback pModuleContext)  
 at Microsoft.SharePoint.Library.SPRequest.EnableModuleFromXml(String bstrSetupDirectory, String bstrFeatureDirectory, String bstrUrl, String bstrXML, Boolean fForceUnghost, ISPEnableModuleCallback pModuleContext)     -
 -- End of inner exception stack trace ---  
 at Microsoft.SharePoint.Administration.SPElementDefinitionCollection.ProvisionModules(SPFeaturePropertyCollection props, SPSite site, SPWeb web, SPFeatureActivateFlags activateFlags, Boolean fForce)  
 at Microsoft.SharePoint.Administration.SPElementDefinitionCollection.ProvisionElements(SPFeaturePropertyCollection props, SPWebApplication webapp, SPSite site, SPWeb web, SPFeatureActivateFlags activateFlags, Boolean fForce)  
 at Microsoft.SharePoint.SPFeature.Activate(SPSite siteParent, SPWeb webParent, SPFeaturePropertyCollection props, SPFeatureActivateFlags activateFlags, Boolean fForce)  
 at Microsoft.SharePoint.SPFeatureCollection.AddInternal(SPFeatureDefinition featdef, Version version, SPFeaturePropertyCollection properties, SPFeatureActivateFlags activateFlags, Boolean force, Boolean fMarkOnly)  
 at Microsoft.SharePoint.SPFeatureCollection.CheckSameScopeDependency(SPFeatureDefinition featdefDependant, SPFeatureDependency featdep, SPFeatureDefinition featdefDependency, Boolean fActivateHidden, Boolean fUpgrade, Boolean fForce, Boolean fMarkOnly)  
 at Microsoft.SharePoint.SPFeatureCollection.CheckFeatureDependency(SPFeatureDefinition featdefDependant, SPFeatureDependency featdep, Boolean fActivateHidden, Boolean fUpgrade, Boolean fForce, Boolean fMarkOnly, FailureReason& errType)  
 at Microsoft.SharePoint.SPFeatureCollection.CheckFeatureDependencies(SPFeatureDefinition featdef, Boolean fActivateHidden, Boolean fUpgrade, Boolean fForce, Boolean fThrowError, Boolean fMarkOnly, List`1& missingFeatures)  
 at Microsoft.SharePoint.SPFeatureCollection.CheckFeatureDependencies(SPFeatureDefinition featdef, Boolean fActivateHidden, Boolean fUpgrade, Boolean fForce, Boolean fMarkOnly)  
 at Microsoft.SharePoint.SPFeatureCollection.AddInternal(SPFeatureDefinition featdef, Version version, SPFeaturePropertyCollection properties, SPFeatureActivateFlags activateFlags, Boolean force, Boolean fMarkOnly)


System.Runtime.InteropServices.COMException: Failed to instantiate file "ContentQueryMain.xsl" from module "XSLStyleSheets": The specified list does not exist.  
 at Microsoft.SharePoint.Library.SPRequestInternalClass.EnableModuleFromXml(String bstrSetupDirectory, String bstrFeatureDirectory, String bstrUrl, String bstrXML, Boolean fForceUnghost, ISPEnableModuleCallback pModuleContext)  
 at Microsoft.SharePoint.Library.SPRequest.EnableModuleFromXml(String bstrSetupDirectory, String bstrFeatureDirectory, String bstrUrl, String bstrXML, Boolean fForceUnghost, ISPEnableModuleCallback pModuleContext)


Unknown SPRequest error occurred. More information: 0x80070002


File Not Found: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Template\Layouts\EditingMenu\SiteAction.xml


System.InvalidOperationException: Feature '94c94ca6-b32f-4da9-a9e3-1f3d343d7ecb' is not activated
 at this scope.  
 at Microsoft.SharePoint.SPFeatureCollection.Remove(Guid featureId, Boolean force)  
 at Microsoft.SharePoint.ApplicationPages.DeactivateFeaturePage.LnkbtnDeactivateFeature_Click(Object objSender, EventArgs evtargs)  
 at System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e)  
 at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument)  
 at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)  
 at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


Error exporting the list named “Announcements” at the URL: Lists/Announcements

1 comment:

  1. Fantastic coding guide lines, development is a very technology field, its completely depends on tricks.

    ReplyDelete