Question

In SharePoint 2010, I created a new site template from an existing site and a new site using this template. After deleting the new site and I cannot deactivate the site template to be able to remove it. Here's the exception I get:

System.ArgumentException: Value does not fall within the expected range.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
Stack Trace: 
[ArgumentException: Value does not fall within the expected range.]
   Microsoft.SharePoint.SPWebCollection.get_Item(Guid id) +27763375
   Microsoft.SharePoint.SPFeatureEnumeratorBase.GetCachedWeb(SPSite site, Guid webId, Guid featureId) +252
[SPFeatureIsOrphanedException: Unable to access web scoped feature (Id: 5c143ca0-e513-4fa5-93a6-a926352c982e) because it references a non-existent or broken web (Id: 196cdf6e-d4a1-4cb6-b962-591aaa3c5f43) on site 'http://win-9o8m2cks1v7'.  Exception: System.ArgumentException: Value does not fall within the expected range.
   at Microsoft.SharePoint.SPWebCollection.get_Item(Guid id)
   at Microsoft.SharePoint.SPFeatureEnumeratorBase.GetCachedWeb(SPSite site, Guid webId, Guid featureId)]
   Microsoft.SharePoint.SPFeatureEnumeratorBase.GetCachedWeb(SPSite site, Guid webId, Guid featureId) +22713369
   Microsoft.SharePoint.SPFeatureEnumeratorBase.GetNextFeatureFromRowset(GetFeaturesState state, SqlDataReader reader, SPSite site) +464
   Microsoft.SharePoint.SPSiteFeatureEnumerator.System.Collections.IEnumerator.MoveNext() +38
   Microsoft.SharePoint.SPFeatureQueryResultCollection.System.Collections.IEnumerator.MoveNext() +26338677
   Microsoft.SharePoint.SPUserSolutionCollection.RemoveFeatureInstancesAndDefinition(SPFeatureDefinition featdef) +770
   Microsoft.SharePoint.SPUserSolutionCollection.Remove(SPUserSolution solution) +279
   Microsoft.SharePoint.WebControls.SolutionItemButton.DeactivateItem() +464
   Microsoft.SharePoint.WebControls.SPLinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +72
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981

I already emptied the recyble bin. Does anybody know how can I deactivate and delete this site template?

Was it helpful?

Solution

You say that you have emptied the Recycle Bin. Are you certain you have emptied all the recycled items in BOTH recycle bins? If not, try this:

Go to the Site Settings page for the root web of your site collection. Under the heading Site Collection Administration, click the Recycle bin link. On the QuickLaunch menu, select End User Recycle Bin items, then select all the items that appear and click the Delete Selection link at the top of the items list. Now select Deleted From End User Recycle Bin from the QuickLaunch Menu and do the same.

Now return to the solution gallery and you should be able to deactivate and delete your solution.

OTHER TIPS

Check your deactivation code. In there you have code that is causing this issue. What I suggest is launch the features page, attach visual studio to all the w3wp processes and put a breakpoint in the feature deactivation. That should show you what is going wrong.

My guess is that you are creating a web object that no longer exists.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top