Tell me more ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a weird error when trying to deploy a solution via Visual Studio 2010:

Error 1 Error occurred in deployment step 'Add Solution': The solution cannot be deployed. The feature 'XXXX-XXXX-XXXX-XXXX' uses the directory "Solution_Feature1" in the solution. However, it is currently installed in the farm to the directory "WepPartName". Uninstall the existing feature before you install a new version of the solution.

Powershell comes with Get-SPFeature and lists all available Features currently installed. The Feature is listed but has no scope. All other features do have scopes which is the first thing that I recognized.

I tried to uninstall the feature using Uninstall-SPFeature cmdlet:

Uninstall-SPFeature : Cannot find a Feature object with Path or Id: XXX-XXX-XXX-XXX in scope Local farm. At line:1 char:20 + Uninstall-SPFeature <<<< -Identity XXX-XXX-XXX-XXX -Force + CategoryInfo : InvalidData: (Microsoft.Share...ninstallFeature:SPCmdletUninstallFeature) [Uninstall-SPFeature], S PCmdletPipeBindException + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletUninstallFeature

I have searched for both the GUID and the web part name on the machine it has been previously deployed but with no success.

share|improve this question

5 Answers

This can occur when an installed feature is renamed. Either reverse the rename or uninstall the feature.

PowerShell's Uninstall-SPFeature <Guid> -force will not work. You should use stsadm -o uninstallfeature -id <Guid> -force instead.

share|improve this answer
PowerShell (Uninstall-SPFeature) did work for me. – Lavinski Apr 10 '12 at 2:11
Powershell worked for me! Thanks! – jumbo Feb 12 at 9:49

Try to uninstall the feature using Uninstall-SPFeature <Guid> -Force, where GUID is the guid that you get from the Get-SPFeature cmdlet.

share|improve this answer

I had a similar issue when using VS while prototyping a feature copied from an existing feature, which was subsequentially deleted thus not allowing me to retract the solution via VS.

anyway resolution as follows using the unistallfeature commannd and ensure you force it.

stsadm -o uninstallfeature -id f6414364-6274-4bc1-ad66-1aa00cfd2944 -force

share|improve this answer
stsadm -o uninstallfeature -id <Guid> -force worked!! Thanks Guys! – user12924 Nov 9 '12 at 5:28

I faced similar issue as a result of SharePoint 2013 farm solution deployment failing in between. If a solution deployment fails it causes the SharePoint 2013 to retract the installed package. However during retraction it just deleted the feature folders and feature xml files copied during solution deployment but since farm scoped features gets deployed on installation remained so in the farm.

So to fix the issue I had to manually copy the feature files to feature folder under 15 hive and then run this command.
stsadm -o uninstallfeature -filename "Feature_Name\feature.xml" -force

share|improve this answer

Since this is only a developer machine I suggest you go hunting in SQL. I have definitely seen solution deployment problems when you delete a Site Collection with solutions deployed and then try to redeploy on a new site collection in the same url. This may be related.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.