Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am having a heck of a time deploying a simple web part to a multi-server farm. The error I receive when deploying is: Error occurred in deployment step 'Activate Features': Feature with Id 'cd488818-dc38-4b3c-aa72-f34ce87a3d41' is not installed in this farm, and cannot be added to this scope.

It has been about a year since I deployed custom web parts to SharePoint 2010. Here are my questions:

  • Is there a way to deploy from VS2010 to a multi-server farm?
  • Can visual web part solutions be deployed only to a site collection? Or only to a web app? What's the scope that I have to use?
  • Is there a PS script to do this?
share|improve this question
    
Is cd488818-dc38-4b3c-aa72-f34ce87a3d41 the Id of your feature or is it a feature dependency? –  Per Jakobsen Jun 1 '12 at 19:32

3 Answers 3

Visual Studio deploys to the server it's installed on, and as a best practice it shouldn't be installed on any production server. During the deployment process, the applicable bits for the solution will automatically be "deployed" to any server in the environment with the Foundation Web Application role. For deployment to production, the correct process would be to generate a WSP file from Visual Studio, load that to a single server in the environment, and use PowerShell Add-SPSolution c:\path\to\solution.wsp to add the file to the solution store. You can then use either Central Administration or PowerShell to perform the "deployment".

Once deployed, your feature(s) can be activated, either through the UI, or through PowerShell. If you have a lot of sites to activate the feature on, say you need to activate branding throughout the environment, you can use something like Get-SPSite | Enable-SPFeature -Identity "SolutionName" -Url $_.Url which will iterate through all site collections and activate the SolutionName solution on each one. Note that this does need to match the scope for your feature (you wouldn't loop through sites for a web application feature, as an example).

share|improve this answer
    
All the deployment to production is the same regardless of number of Servers (Except SharePoint has to do more work when multiple). If you have more than 20 site collections you need to add -Limit All to Get-SPSite. A Visual web part usually has an elements.xml with a <Module> element to add the .webpart file to the Gallery <Module>s can only be in features with scope Site (Site Collection) or Web (Site) and you usually want to use scope Site –  Per Jakobsen Jun 1 '12 at 19:31

For Web Parts your feature must use the Site scope. The Web Part Gallery only exists on the Site Collection level.

share|improve this answer

I will add the following mentioned to the valid answers before me, in an attempt to answer some of your questions:

  1. You can deploy a Visual Web Part for a single Site Collection if you make it as a Sandbox solution and upload it to the Gallery (CKSDEV NuGet Package in Visual Studio 2010 is needed to get you support for Visual Web Part in Sandbox). If you have a Farm solution, you can Activate it only on the specific site collection (or simply hide-it from the WebParts Gallery - more work).
  2. Multi-farm deployment requires re-deploying your solution multiple times PER FARM
  3. Other participants have responded
share|improve this answer

Your Answer

 
discard

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

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