locked
Need to deploy the web part on client application ? RRS feed

  • Question

  • Hi all ,

    I have used the powershell to deploy the application on client machine using following query

     SPSolution-{j:\Applications\Expert3D\Sample_Webpart}.wsp-WebApplication http://rivaprod:47667/-GACDeployment

    But the error is as like as follow

    The term 'SPSolution-' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
    At line:1 char:12

     

    So please help me to fix the same

     

    Wednesday, January 25, 2012 12:12 PM

Answers

  • Are you trying to add and deploy your solution to the farm solution store?

    First you need to add the solution to the store:

    Add-SPSolution "j:\Applications\Expert3D\Sample_Webpart.wsp"
    

    Then you need to deploy the solution:

    Install-SPSolution -Identity "Sample_Webpart.wsp" -WebApplication "http://rivaprod:47667" -GACDeployment

    Make sure that you are either using the SharePoint 2010 Management Shell or have loaded the requisite powershell modules first. You also need to run it as a user with sufficient rights.

     


    Ceej
    www.3guysonsharepoint.com
    Wednesday, January 25, 2012 12:32 PM

All replies

  • Hi,

    If you are running the above command, then its incorrect. To deploy a solution using powershell you should first add the solution to central admin solutions gallery .. To do so run the below powershell commands from Sharepoint 2010 Management shell
    Add-SPSolution c:\deploy\MySolution.wsp
    
    

    Then to install that solution use the following command
    Install-SPSolution –Identity MySolution.wsp –WebApplication http://testerver:1234 -GACDeployment
    
    
    

    Refer this to create a smart powershell script for the same
    Regards,

    Priyanka
    Wednesday, January 25, 2012 12:27 PM
  • USe the command:

    Add-SPSolution -literalpath "c:\deploy\MySolution.wsp"


    Varun Malhotra
    =================
    Please mark answer as answered if the answer is helpful. This allows other users to use the forums efficiently.
    Wednesday, January 25, 2012 12:28 PM
  • Are you trying to add and deploy your solution to the farm solution store?

    First you need to add the solution to the store:

    Add-SPSolution "j:\Applications\Expert3D\Sample_Webpart.wsp"
    

    Then you need to deploy the solution:

    Install-SPSolution -Identity "Sample_Webpart.wsp" -WebApplication "http://rivaprod:47667" -GACDeployment

    Make sure that you are either using the SharePoint 2010 Management Shell or have loaded the requisite powershell modules first. You also need to run it as a user with sufficient rights.

     


    Ceej
    www.3guysonsharepoint.com
    Wednesday, January 25, 2012 12:32 PM
  • Hi Priyanka,

    Thanks for reply,

    I have used the same approach which is told by u. The name and id of the web part is created while using the first command,

    But while using the second command for installing the web part it shows the error like as with the command as follow

    PS C:\> Install-SPSolution -Identity Sample_Webpart.wsp -WebApplication http://rivaprod:47667 -GACDeployment
    Install-SPSolution : Cannot find an SPWebApplication object with Name, Id, or Url: http://rivaprod:47667.
    At line:1 char:19

    Wednesday, January 25, 2012 12:46 PM
  • Try

    Install-SPSolution -Identity Sample_Webpart.wsp  MySolution-GACDeployment -force

    to install the WSP globally( not specific to one web app). 

     If it does then there is some problem with the  web app url your provide..  If you are running powershell on the same server then try http://localhost:47667 .. (Do not use any spaces in the url)

     


    Priyanka
    Wednesday, January 25, 2012 12:59 PM
  • HI Priyanka,

    Thanks for quick reply,

    Yes it is working I think  there is problem with my url. check the following 

    PS C:\> Install-SPSolution -Identity Sample_Webpart.wsp -GACDeployment -force
    Install-SPSolution : This solution contains resources scoped for a Web application and must be deployed to one or more Web applications.

     

    Wednesday, January 25, 2012 1:14 PM
  • You can use the -AllWebApplications parameter - this will allow deployment to all web applications.

    Install-SPSolution -Identity Sample_Webpart.wsp -GACDeployment -AllWebApplications
    

    It would be good to identify why deploying to the specific web app does not work. Presumably if you browse to the url in IE then your SharePoint site can be successfully accessed? 


    Ceej
    www.3guysonsharepoint.com
    Wednesday, January 25, 2012 3:04 PM
  • Did you tried what  ceej_3GuysonSharePoint suggested below .. ?
    Priyanka
    Thursday, January 26, 2012 5:53 PM
  • HI 
    ceej_3Guys,

    I have used your installation command and its working properly and my web part is deployed on system. Thanks.


    Friday, January 27, 2012 3:56 AM
  • HI Priyanka,

    I have used the command stated by ceej_3Guys  and its working properly and my web part is deployed.

    Really Thanks!


    Friday, January 27, 2012 3:58 AM
  • Glad to help.
    Ceej
    www.3guysonsharepoint.com
    Friday, January 27, 2012 8:44 AM