Sunday, August 31, 2014

Error Type: Error occurred in deployment step 'Add Solution': A feature with ID has already been installed in this farm. Use the force attribute to explicitly re-install the feature.

When i was working with migration projects, We have several SharePoint 2010 solutions which we want to deploy to SharePoint 2013 with Visual Studio 2012 running on Windows Server 2012. I get the error "A feature with ID 15/... has already been installed in this farm. Use the force attribute to explicitly re-install the feature."

Solution for this, we need to deploy the solution forcefully and this can be done two ways.

1. From visual studio we can deploy the solution forcefully
2. Using power shell command also we can deploy the solution forcefully.


1. Using Visual Studio

Go to your Features in your project.

i. Open the feature.template.xml file

ii. add AlwaysForceInstall="TRUE" to the below tag

<Feature xmlns="http://schemas.microsoft.com/sharepoint/" AlwaysForceInstall="TRUE">

Now try to deploy the code.

(OR)

i. Click on your project
ii. Go to Features and double click on features
iii. now press F4 to view properties
iv. now change "Always Force install" from false to true.
v. now build and deploy the solution.


2. Using Power Shell

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

No comments:

Post a Comment