3
votes

I'm trying to deploy a simple web part to SharePoint 2013 using Visual Studio 2013 and I am getting the following error:

Error occurred in deployment step 'Activate Features': Feature with Id '....' is not installed in this farm, and cannot be added to this scope.

Spent a long time trying to find a solution to this. Several blogs and forums talking about it and giving different solutions (none worked for me).

Feature scope is set to site, and solution is not set to sandbox.

Deployment works if I select the option to skip activation. But then when I go to Site settings and look at features I cannot find it. (I looked at both Site Features and Site Collection Features).

I have tried to change permissions in several different places. I made the user the site owner as well as the site collection administrator (tried both primary and secondary), but it didn't seem to make a difference.

I'm new to the whole complicated world of SharePoint, so bare with my lack of exact terms. Before going for this farm solution I tried with sandbox and everything worked fine: I was able to debug and deploy.

I know there's a way to deploy using PowerShell but I don't think that's the ideal solution here.

Any suggestions? Thanks!

1
have you tried deleting the features in the solution and creating them again?Choggo
I have, but every time I deploy them I have to go through the whole process of installing, disabling, enabling, through PowerShell. There must a reason why this is happening.Naner
I meant in the actual Visual studio project, deleting and recreating them. Have you made any changes to the Solution package properties? (changed what type of server they affect/include assembly in package and things like that?) Also, does you solution reference Features from a second Visual studio project?Choggo

1 Answers

0
votes

if you skip activation you should deploy feature by script.

Steps to deploy a webpart

1 - in the project settings go sharepoint and select "No Activation" for "Active Deployment Configuration"

2 - Deploy the project

3 - Run the code below in management shell (Run as administrator the management shell)

 install-spfeature "yourProjectName_FeatureName"           /*exp: TEST.Webparts_Feature1*/

4 - Deactivate - activate fature in "Site Collection Features"