Search This Blog

Saturday, January 31, 2015

What is a Solution Package?


A solution is a deployable, reusable package that can contain a set of Features, site definitions, and assemblies that apply to sites, and that you can enable or disable individually. You can use the solution file to deploy the contents of a Web Part package, including assemblies, class resources, .dwp files, and other package components. A solution file has a .wsp file extension.

How to add the solution to the sharepoint farm and then deploy it to a particular web application is discussed below.

1. Adding solution package to the server

stsadm.exe -o addsolution -filename myEventCalendarList.wsp
OR
Use the complete location of the file, for example:
stsadm.exe -o addsolution -filename "C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions14BINSolutionmyEventCalendarList.wsp"
Deploy solution package
Deploy solution package command

2. Deploying the Solution

Deploy the solution using the following command:
stsadm -o deploysolution -name myEventCalendarList.wsp  -url http://sp-dev/ -local  -force
Here( -url) means the web application where to deploy the solution.
OR
Goto, Central Administration > System Settings >Manage farm solutions
Now click your solution from the list (for example, myEventCalendarList.wsp).
[
65d0
caption id="attachment_381" align="alignnone" width="830" caption="Manage farm solutions"]Manage farm solutions[/caption]
a)  Now click Deploy Solution and select the web application where you want to deploy the solution (example,http://sp-dev here), Click OK when you are done.
select the web application
Click Deploy Solution
Select web application
Select web application where you want to deploy
b)  And finally you will have your solution deployed status like the following.
solution deployment status
solution deployment status
You are done with deployment.

OPTIONAL STEP (You can do it when necessary):

Now you have to enable this feature at the website to use it. To do it follow these steps:
3.  Enable the features at the website>>
Go to your Site settings> Site Collection Administration > Site collection features
And activate the feature (myEventCalendarList ,for example)  that you have installed. And add that webpart  to your site to test.

Importing SharePoint Solution Package (WSP) into Visual 
Studio 2010
In this article I’m talking about importing WSP as a result of exporting site template into visual studio 2010.
1-      Go to site setting -> Save site as template

2-Give exported template a name and description, and check Include Content checkbox in case you want to export all site contents
3- Go to site setting,  You will get a link to your “solution gallery”, which has your template.
4-Open visual studio 2010 -> Create New Project  ->Import SharePoint Solution Package
5- Select “Deploy as Farm “ option
6-Select the path of existing solution

7-    After importing this WSP, a wizard will appear with all contents of WSP and give developers to select and deselects items.
8-Visual studio Solution

No comments:

Post a Comment