Wednesday, July 21, 2010

How to deploy a SharePoint 2010 solution developed by visual studio 2010 to another server using Powershell commands

Normally we can deploy the visual studio solution using the IDE. but then we need to SharePoint run on the same local machine which is used to the development. using   powershell as well as stsadm commands  you can deploy it to another server.

  • copy the content of the bin folder. ( Normally 3 files with .wsp solution file). if the files are not available you can click build and package menus in the IDE to create those files. (of cause you also can get the release folder content if you change the IDE mode to the release)
  • then copy the content to the server which you want to deploy. (for the moment assume you copied it to C:\solution folder , and assume you have a wsp file named abcsolution.wsp)
  • open the powershell window. if the current user have no permission you may need to run is s administrator.

               image

  • Then you need to add the solution to the solution store. for that
    • Add-SPSolution -LiteralPath C:\Solution\abcsolution.wsp

image

  • then you need to install it to the web application.
    • Install-SPSolution –Identity abcsolution.wsp  -WebApplication http://server
  • some times it asks for GAC permission then you need to specify –GACDeployment
    • Install-SPSolution –Identity abcsolution.wsp  -WebApplication http://server -GACDEployment

      image

Post a Comment