How to deploy WSP (Solution Packages) file in SharePoint 2010?
There are few assumptions before making this wsp solution deployment :
- You have a Visual Studio 2010 installed on your machine and SharePoint project set up and ready to go.
- The project compiles with success.
- Are able to use Powershell to execute your quick commands.
How to Generate WSP ?Here to follow the deployment process, follow the simple steps as follow:
- The first step is to build your project by right clicking on your project/solution in Visual Studio 2010 and choose "Build".
- Depending on your configuration, you can build to a debug or release directory.
- Browse the location from your computer directory which will be located in "C:<Project Directory>bin<release or debug>".
You can see the files - an assembly dll and your .wsp file in your location shown in the left image. So this is the WSP file which you will be required for your solution deployment in SharePoint 2010.
How to deploy a SharePoint 2010 WSP ?Depending your approach, you can execute below commands in Power Shell in SharePoint
- Add Solution
Add-SPSolution c:<path><solution filename>.wsp
- Deploy/Install Solution
Install-SPSolution –Identity <solution file>.wsp –WebApplication http://<url> -GACDeployment
- Update Solution
Update-SPSolution –Identity <solution file>.wsp –LiteralPath c:<path><solution file>.wsp –GACDeployment
- Uninstall Solution
Uninstall-SPSolution –Identity <solution file>.wsp –WebApplication http://<url>
- Remove Solution
Remove-SPSolution –Identity <solution file>.wsp
Verify that your assembly is the GAC (C:windowsassembly) and then go activate any features you may have had in your solution.