0

I have a VS2012 solution with a few visual web parts in it. When I run the project it deploys it to my local server and my web parts are available for my local sharepoint.

How can I deploy these new custom visual web parts to a remote sharepoint server (my client)? I was under the impression a package was built that I can import elsewhere but it doesn't seem that easy.

Any guidance/suggestions greatly appreciated!

2 Answers 2

1

Right click on the solution and select Package. This will build a WSP in either your debug or release folder. Copy this WSP to a web front end and use Powershell to add it to the solutions and then install it.

Add-SPSolution c:\yourproject.wsp
Install-SPSolution –Identity yourproject.wsp –WebApplication http://sp2010 -GACDeployment

Or use the add operation, then in central admin, manage the deployment.

2
  • OK that seems like a good start. Thanks. What about the DLL for my web parts? I tried to include them in the package but I get an error that the path conflicts with the .csproj build dir.
    – Alex
    Commented Apr 21, 2014 at 19:53
  • 1
    The DLLs will be included in the WSP when packaged. To verify, after packaging, rename the WSP to CAB and you can see all the contents, you should see your DLLs. Commented Apr 21, 2014 at 20:30
0

You need to use powershell to upload the wsp from bin or build folder of the application. When you deploy on your local machine on a local server it creates the wsp within the build are that you chose... from there sharepoint uses that wsp to deploy to sharepoint central admin and activates the wsp.

the dll of the project is added in within the wsp uppon deployment (creation of the wsp). To have the project dll added into the gac the project needs to be strongly named by that i mean you need to:

goto visual studios -> click on project (top menu) -> click on properties -> click on signing -> make sure "sign the assembly" is checked -> choose a key from the drop down list as an example i have key.pfx... if not click on new and give it a name and password -> re deploy project and use the new wsp... if its already there than there is no need.

to deploy the wsp other than your local machine than you need to goto onto the server and use powershell from there! you cant do it from your local pc to a remote server like (test, preprod or prod).

use pirateEric powershell command.

add wsp to server:

This example adds the SharePoint solution in the file contoso_solution.wsp to the farm.

Add-SPSolution -LiteralPath c:\contoso_solution.wsp

http://technet.microsoft.com/en-us/library/ff607552(v=office.15).aspx

deploy wsp (activate wsp):

This example deploys the installed SharePoint solution contoso_solution.wsp in the farm and specifies that GAC can be deployed for the new SharePoint solution.

Install-SPSolution -Identity contoso_solution.wsp -GACDeployment

http://technet.microsoft.com/en-us/library/ff607534(v=office.15).aspx

update wsp on farm:

This example upgrades the deployed SharePoint solution contoso_solution.wsp to the solution c:\contoso_solution_v2.wsp.

Update-SPSolution -Identity contoso_solution.wsp -LiteralPath c:\contoso_solution_v2.wsp -GACDeployment

http://technet.microsoft.com/en-us/library/ff607724(v=office.15).aspx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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