SharePoint 2013 - Features bez Scope
Problém
Na SharePointu jsem nalezl Features, které neměly žádný Scope. Nešly odstranit, jelikož k nim chyběly soubory na disku. Občas generovaly neznámé chyby.
Příklad generované chyby
Failed on try1 to load XML document at path 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\Template\Features\MyProject.MyFeature\feature.xml': System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\Template\Features\MyProject.MyFeature\feature.xml'.
Failed on try2 to load XML document at path 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Template\Features\MyProject.MyFeature\feature.xml': System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Template\Features\MyProject.MyFeature\feature.xml'.
Řešení
Našel jsem nástroj, který tyto Features identifikuje, popř. s nimi může provést i deaktivace. Jmenuje se SharePoint Feature Administration and Clean Up Tool a je volně ke stažení na CodePlex.com
Dále jsem našel článek, který popisuje jak identifikovat a smazat tyto Features pomoci Power Shellu.
Výpis samostatných features
Get-SPFeature ' ? { $_.Scope -eq $null }
Odstranění samostatných features
Get-SPFeature ' ? { !$_.Scope } ' % { $_.Delete() }
Odkazy
- SharePoint Feature Administration and Clean Up Tool
https://featureadmin.codeplex.com/ - How to remove orphaned features
https://sharepoint.stackexchange.com/questions/16525/how-to-remove-orphaned-features
