Note: Forums will be making significant UX changes to address key usability improvements surrounding search, discoverability and navigation. To learn more about these changes please visit the announcement which can be found HERE.

Answered how to deploy a web part in a sharepoint farm

  • Wednesday, May 09, 2012 5:30 AM
     
     

    hi,

    i am facing issues - feature id not deployed - while deploying my custom web part in my SP farm environment. i am having  box1---> SP 2010-VS 2010 with sql server 2008 Devlper installed, and created a new farm .

    While installing SP 2010 on box2-->SP 2010 aske dme the connect to the existing farm, so i said, yes, and gave the sql server db of server of  box1.

    so i started  creating visual web part when i pressedf5 , i got the below error:

     

    Error 1 Error occurred in deployment step 'Activate Features': Feature with Id '6676b54a-4efb-4528-92fd-4a4a77376fee' is not installed in this farm, and cannot be added to this scope.
      0 0 FAQWebPart

    Feature scope is set to SITE only.

    am stuck with why i am  unable to deploy this web part.

    i also tried with a simple feature with a  receiver that alos resulted in the same kin dof error.

    thnx for any help

     

     

All Replies

  • Wednesday, May 09, 2012 5:57 AM
     
     Proposed

    Hi,
    the Deploy functionality in VS 2010 only works for single server farms. You need to use the Package option and then PowerShell to deploy your solution to your farm.

    Right click on the project, select Package (instead of Deploy).
    Open a SharePoint 2010 Management Shell and navigate to the output folder of your project.
    Re-deploy or upgrade your solution using PowerShell (depending on what changes you've done).

    Regards,
    Martin

  • Wednesday, May 09, 2012 11:18 AM
     
     

    Hi Martin,

    thnx for the reply.

     Is there any  settings in VS 2010  so that, its deployed ONLY ON the local machine  from where i am pressing F5.so that for me debugging is also become easy. something  like -local  infront of deployment target?

    help is appreciated.' 

    .

  • Thursday, May 10, 2012 7:01 AM
    Moderator
     
     

    Hi Benjamin,

    As Martin said, the error occurs because that VS 2010 does not support features activation on multi-server farms, that it internally implements a call to the method SPSolution.DeployLocal, the method is intended for troubleshooting purposes of wsp files and performs a local deployment instead of an immediate deployment.

    It is recommended that you have two environments, one is developing environment, that used for developing needed solutions for SharePoint, and the other one is production environment. First create and debug the solutions on dev environment, then deploy it to the production.

    Thanks,
    Qiao


    Qiao Wei

    TechNet Community Support

  • Thursday, May 10, 2012 7:15 AM
     
     Answered

    Hi Benjamin,
    you should be able to reconfigure what happens during a deploy. I dont have VS available right now and dont remember where you do it.

    I always recommend not using VS to deploy solutions. During the deploy process VS performs cleanup actions on your site (deleting lists and content types etc). Its better to deploy your solutions on your dev environment the same way as you do on production - i.e. not with VS.

    This is how I work:
    Write code, create content types, lists etc.
    Right click on the project and select Package
    Go to PowerShell and reinstall/upgrade your solution
    Press Ctrl-Alt-P in VS if you want to debug.

    Have a look at CKS.Dev (http://cksdev.codeplex.com). Great plugin for VS for quick deploys of assemblies and SharePoint Root files.

    Why do you have a multi-server farm for development if you only want to deploy your solution locally? Either you deploy localy to a single-server farm or you deploy to all servers in a multi-server farm.

    Regards,
    Martin

    • Marked As Answer by Benjamin KNR Saturday, May 12, 2012 7:58 AM
    •  
  • Friday, May 11, 2012 9:35 PM
     
     

    hi Martin,

     thnx again for the reply. We would be developing collaboration portal which should have a multiserver farm envn. as part of the reqmnt which has

    2 WFEs , 1 index server, 1 DB server .So what i thought that, we we should be working on the farm environment from the first day itself and once we reach sprint1 we will add another box as index server in the existing 2 server farm env. so that we can replicate the  same  customer environment during devlpmnt itself and find out the occurence of critical issues and fix those during devlpmnt time itself like crawling,issues related  to user profile service,managed metadata service[ taxonomy/term store..] etc . That was  the motive behind these farm installation in those 2 windows 7 environments.

    anyway,  after seeing your reply we have decided to uninstall the SP and  reinstall as a  stand alone one and we have started this  exercise, so that we can debug the code fast.

    and yes i have installed the  cks dev in one of my win2k8 servers.but not started  using it. Will go thru it and update. thanks for pointing.  

    thnx

    Benjamin


    • Edited by Benjamin KNR Saturday, May 12, 2012 8:04 AM abt cks dev
    •