35

We have several SharePoint 2010 solutions which we want to deploy to SharePoint 2013 with Visual Studio 2012 running on Windows Server 2012. Site solutions work. But farm solutions just don't. I get the error (you guessed it): A feature with ID 15/... has already been installed in this farm. Use the force attribute to explicitly re-install the feature.

And it does really work with the force attribute, but why on earth do you have to use the force flag? Something has to be different, and if there is an already installed feature with this ID, then why can Visual Studio not uninstall or deactivate it by itself first? This error never occurred with SharePoint 2010 and VS2012, although features are already installed.

Thanks a lot for your effort.

  • Just to mention that i received this error with features that provisioned only list and content type. Provided solution above resolved the problem. – ikirachen Feb 15 '16 at 7:17
47

Welcome to SharePoint Stack Exchange! In your Visual Studio 2012 SP Solution:

Enable Always Force Install to True in for your feature. See example below: enter image description here

By default, it is set to False. You can configure that to be set to True.

  • After receiving the error and fixing it by forcing the install, I was able to set this value back to False and it continued to successfully deploy. – soniiic Nov 18 '14 at 10:29
  • 1
    Do not forget to do this for all the features in your solution.In my case I have done this for only one feature but different feature having the trouble and whole feature activation not success till I set force to all. – Prageeth godage Mar 23 '15 at 11:25
11

This error happens if you deploy a solution which contains a visual web part to a different web application on the same farm as the web application where it is already installed. In other words, you have two web applications, A and B on the same SharePoint farm. You want to deploy solution S which contains a visual web part to web application B, but it is already deployed to web application A. If you deploy the solution S to web application B, you will receive this error. The MSDN article Troubleshooting SharePoint Packaging and Deployment mentions this problem is caused by a visual web part. This is imprecise. It is caused by the user control (a visual web part contains a user control). You may face this error in any package which contains a user control.

In PowerShell, you can use the -Force parameter of the Install-SPSolution commandlet in order to force the installation of a solution:

Install-SPSolution -Identity <solution_file> -GACDeployment -Force
8

within your solution click on feature.feature and goto its properties, you should now see somthing on the lines of Always Force Install just set that to true and you dont need to do the force attribute anymore!

looks like a feature wasnt retracted properly and has become a phantom! ybs has a similar issue here!

  1. Visual studio

  2. Both site collections are in the same web application in the same farm running on a single development machine

  3. The first deployment attempt after the change produces this error:

"Error occurred in deployment step 'Add Solution': Failed to load receiver assembly "" for feature "" (ID: ).: System.IO.FileNotFoundException ...

  1. The second deployment attempt after the change produces this error:

Error occurred in deployment step 'Add Solution': A feature with ID 15/ has already been installed in this farm.

After that the feature is no longer usable. This has worked without a problem in the SharePoint 2010 version.

http://social.msdn.microsoft.com/Forums/sharepoint/en-US/39a97d92-9c72-4414-984e-70c9d2d5f8cf/feature-reciever-problem-with-sharepoint-2013-rtm

  • "looks like a feature wasnt retracted properly and has become a phantom! ybs has a similar issue here!" Thanks, this might be a reason. But do you know, how I get VS2012 to retract a feature properly without using the force attribute? "Retract" in the context menu doesn't seem to work. – JennyK Dec 11 '13 at 9:44
  • please follow this guide, lyndzhang.wordpress.com/2013/03/26/… – Ali Jafer Dec 11 '13 at 9:48
  • Do I really have to do this every single time I want to deploy a solution? With SharePoint 2010 it worked with one click in Visual Studio.. I'm confused... – JennyK Dec 11 '13 at 9:55
  • no you shouldnt need to do this every time with visual studios! visual studios should be able to handle this! what i presume is somthing during the retraction got corrupt and you only need to do that on this instance! if you were to make a test feature (blank) and use vs to deploy and do it again re-deploy this time with a little change like adding in some code and see what happens... it should work fine! – Ali Jafer Dec 11 '13 at 10:04
  • so you do the above to remove the conflicting feature from sharepoint, then you can use vs to deploy... it should work fine as its like deploying from new, there shouldnt be any instance of that feature on the server – Ali Jafer Dec 11 '13 at 10:06
5

A better way to solve this without adding force is after the error happens, just leave the wsp there with the error in CA, open the SharePoint Management Shell and use the update-SPSolution command with the path of the wsp file you just added to deploy, it should also deploy itself after the update.

Update-SPSolution -Identity "name wsp" -LiteralPath "path wsp" -GACDeployment
2

I had this same issue and found that it was because of Orphaned Feature. There are chances that whenever you remove wsp from farm and redeploy it, then Feature associated with that wsp might not got deleted properly. this feature will not be listed in your powershell also when you try to search which features are available in your farm. So better way to resolve this issue is to first list out all ORPHANED Feature.

PowerShell Command: Get-SPFeature | ? {$_.Scope -eq $null}

This command will give you all orphaned features. After that you can delete this orphaned feature by using their Display Name as you can not use ID to delete this features.

PowerShell Command to Delete Orphaned Feature:

$feature = Get-SPFeature | ? {$_.DisplayName -eq "OrphanedFeatureName"}
$feature.Delete()

Hope this will help someone

1

Go to the Manifest.xml and add the AlwaysForceInstall="TRUE" to it. This will allow you to deploy your solution now.

  • Nice point any drawbacks of the same? – Akshay Randive Jun 18 '15 at 15:19
1

In Feature.XML add AlwaysForceInstall="TRUE" parameter

<?xml version="1.0" encoding="utf-8" ?>
<Feature AlwaysForceInstall="TRUE" xmlns="http://schemas.microsoft.com/sharepoint/">
</Feature>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.