In my last article, we saw how to create a SharePoint farm solutions project. After we have completed the project development, we can deploy the WSP to the SharePoint Server. WSP will be available after we publish the project in Visual Studio.
Steps to Add, Install and Update the WSP
Follow the below listed steps to deploy the WSP in SP Server.
Open the SharePoint Management Shell with administrator rights in Server.
Now, add the WSP solution first using the below command,
Add-SPSolution “Documents\Your WSP Name.wsp”
Open the Central Admin and go to System Settings from the left navigation. Now, select “Manage Farm Solutions” to check the status of your solution.
INSTALL SP solution
Then, install the WSP to the WebApplication by running following command in Management Shell,
Install-SPSolution –Identity “WSP Name”.wsp –WebApplication “Site Url” –GACDeployment -fulltrustbindeployment -force
Install-SPSolution –Identity “SampleSPProject.wsp” –WebApplication “http://test:8888/” –GACDeployment -fulltrustbindeployment -force
Finally, your solution will be deployed successfully. We can check the status in Central Admin, as shown in below image.
If we want to update the solution, we can use the below command in PowerShell to update the previous solution,
Update-SPSolution -Identity “WSPNAME.wsp” -LiteralPath “PATHFORWSP\SampleSPProject.wsp” -GACDeployment -FullTrustBinDeployment -Force
Update-SPSolution -Identity “SampleSPProject.wsp” -LiteralPath “C:\Workings\AE_WSP\SampleSPProject.wsp” -GACDeployment -FullTrustBinDeployment –Force
In Central Admin’s “Manage Farm Solutions, we can check the status, as shown below.
Finally, our solution will be updated successfully.
Run the below command to uninstall the WSP in Management Shell.
Uninstall-SPSolution -Identity “wspname.wsp”
Uninstall-SPSolution -Identity “SampleSPProject.wsp”
When you uninstall the WSP it ensure that to perform this operation as shown below, type “Y” to proceed,
Use the below command to remove the WSP solution.
Remove-SPSolution –Identity “SampleSPProject.wsp” -force
In this article, we have explored how to add, install, update, remove and uninstall the WSP package in SharePoint 2016 server.