SharePoint 2010 & Visual Studio 2010 error ocurred Activate Features Feature with ID installed in this farm cannot be added to this scope.

Hello

Maybe most of you have faced the following VS 2010 error message when trying to debug or deploy a wsp file via VS 2010 in a multi-server farm:

Error occurred in deployment step 'Activate Features': Feature with Id '2447ad0c-98d2-4363-9ef0-f217694f804e' is not installed in this farm, and cannot be added to this scope.  

Basically the error happens because VS 2010 do not support features activation on multi-server farms.

However ,the devil is in the details, the exact explanation is in a previous step. It turns out that VS 2010 internally implements a call to the method  SPSolution.DeployLocal https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spsolution.deploylocal.aspx . That method is intended for troubleshooting purpouses of wsp files and as you can read on the MSDN documentation it performs a local deployment instead of an immediate deployment (Only to one sever of the farm)

Therefore, the only solution to avoid the situation is to compile the code (build o re-build) , go to the VS 2010 top menu and select build -> package. After that a new wsp file will be created on the BIN folder of the project.

Eventually, now you are free of selecting ,PowerShell or STSAdm, in order to add a solution, deploy it and activate it

Thanks

Kind Regards.

Héctor Calvarro Martín. SharePoint Dev. Microsoft Support Engineer for DEV EMEA