Deploying Sharepoint Solution


  • Hello

    I have developed site for customer in sharepoint foundation. I want to deploy it on customer server. My development server is single , stand alone server without AD, no domain controller.

    I have taken the wsp by saving the site as template from the site setting.

    Now I want to use this wsp o deploy on customer server.

    My method is :

    I create one web application.

    I create one blank site collection(by choosing the option, select the site template later).

    Then after creating the site collection, it will ask me to select solution. I upload that wsp on newly collected site collection, on base of that wsp, the root site is created.

    This is my method to deploy on customer/production server. I think this way, wsp is deployed as a sandbox solution.

    Is it right way to deploy?


    -Chetan patadia

    Friday, June 29, 2012 3:22 PM

All replies

  • Instead of selecting the site template later, you can have it in custom template gallery while creating new site collection

    Other way around is Save site as a template and save to your local machine as wsp.Open powershell and add and  install the Wsp to the SP farm. run following commands

    Add-spsolution -literalpath "Path to your WSP"

    Install-spsoluton "custom.wsp" -gac

    Once its deployed to the farm.... go to Manage farm solutions and check your WSP. Then you should go to create site collection page and would be able to see your custom template under Custom tab and will be able create new site

    B Singh

    Friday, June 29, 2012 4:04 PM
  • Hello B Singh

    Thanks for the reply.

    The two commands which u told are for deploying the solution as a farm solution.

    When I use second "Install" command, error is -

    " Install-SPSolution: This solution contains no resources scoped for a Web application and cannot be deployed to a particular Web application.
    At line:1 char:19 + Install-SPSolution <<<<  -Identity DeploymentTest.wsp -WebApplication http://SPserver1:10000/ -GACDeployment + CategoryInfo:InvalidData:(Microsoft.Share...InstallSolution:SPCmdletInstallSolution)[Install-SPSolution],SPException + FullyQualifiedErrorId:Microsoft.SharePoint.PowerShell.SPCmdletInstallSolution"

    When I did :

    1.New site collection, in which i do not select any template, just select "later".The command is

                   New-SPSite "http://localhost:10000" -OwnerAlias administrator

    2.Add the solution by using - 'Add-SpUserSolution' command

       Add-SPUserSolution -LiteralPath "D:\Test\DeploymentTest.wsp" -Site "http://localhost:10000"

    3.Install the solution by using - "Install-SpUserSolution' command

             Install-SPUserSolution –Identity DeploymentTest.wsp -Site "http://localhost:10000"

    This is working fine. I think this is sandbox deployment.

    But if I use Add-SPSolution/ Install-SPSolution command, then errrors are there. Where I am making the mistake...?

    Saturday, June 30, 2012 6:12 AM
  • Hi Chetan,

    When you save a site template it is scoped to 'Site' by default but not to 'Farm'. That was the reason you got the error message "This solution contains no resources scoped for a Web application and cannot be deployed to a particular Web application."

    One way to find the scope is to rename your "yourtemplatename.wsp" to "" and extract it to a folder. BTW WSP files are CAB files.

    Check the feature.xml for your template scope.


    MCITP: SharePoint 2010 Administrator
    MCTS - MOSS 2007 Configuring, .NET 2.0
    | SharePoint Architect | Evangelist |

    Sunday, July 01, 2012 5:44 AM
  • Hi Chetan.

    I would say, that the way you are doing it is the way to do it.
    If it is a site collection scoped sandboxed solution, you need to deploy it to a site collection and the 'Microsoft SharePoint Foundation Sandboxed code service' is running or the sandboxed code will not run.

    (B.t.w. Sandboxed or Farm is something you set on the solution in Visual Studio.)

    Keep doit it the way you are doing it!


    Thomas Balkeståhl - Technical Specialist - SharePoint -
    Download the SharePoint Branding Project here
    Download the SharePoint 2010 Site Settings Explained here

    Sunday, July 01, 2012 6:00 AM
  • You can use the following command

    install -spsolution Test.wsp -gac -force

    If you want to change the scope, then open this wsp in visual studio and check the properties and change the scope to web application. Then you can use the same old command where you were getting error while deploying to web app...

    B Singh

    Monday, July 02, 2012 2:38 PM
  • Hello Thnaks for the reply...

    For Some more clarily and confidance:

    I have developed Document management System with some other custom requirements as per the customer needs. I have taken the wsp by saving this site as "save site template". I told the way I deploy. My customer will resale it to other cusotmers. The whole deployment , Installation ...etc will be guided by me once. So the way I am going is the right way in this scenario also....?!

    And another question is that : I want to alos protect this wsp against illegal copy. Means my customer will resale it as per the duration wise (1 year/2 year...etc), and per web front end server wise... This wsp should be locked after the expiry of usage period and it must not allow to install on other server unless product key is provided... How to achieve this golal...?



    Tuesday, July 03, 2012 5:43 AM