About Me

I am a Software Engineer presently working in Microsoft as vendor.The main aim of this blog is to Share my knowledge in Sharepoint,AZURE and Silverlight.

Thursday, 12 June 2008

How to Generate a WSP (solution package)

Hi ,

Today i m going to blog How to generate a WSP when we have individual Dll's to be deployed in to gac other than features,files to layout folder etc..,

Creation of WSP.

WSP is a SharePoint solution Package.
The WSPBuilder is a console application that creates SharePoint Solutions files
based on a folder structure. WSPBuilder will automatically traverse a "12" folder structure
and creates a SharePoint solution manifest.xml and the WSP file based on the files it finds.
Therefore you do not need the knowledge of how to create a solution manifest.xml
and WSP file any more.
Steps for Create WSP.
Step1: Create a Class Library Project.
Step2: Create a “12” folder Structure and paste the folder in to your project. The “12” folder Structure should contain all the required files to be deployed.
For example the entire feature files to be deployed in to Features folder. Custom files to be deployed to Layouts folder. Etc...


Step3: Make a strong name key. (Sign the Assembly)
This can be done by clicking on the properties of the project and select the “Signing”.
Check the check box “Sign the Assembly”.
Select “New” in the Choose a Strong name Key file section and give the name for strong name key.
Step4: Build the Project in Release Mode.
Step5:
Open the folder of your current project from file system. It looks like below.

Step6: Copy the files (WSPBuilder.exe, Cablib.dll, and makecab.exe) in to the folder. It should look like below
WSPBuilder.exe: Download the WSP builder.exe from the below link.
http://www.codeplex.com/wspbuilder/Release/ProjectReleases.aspx?ReleaseId=11603
makecab.exe: Copy the file from C:\WINNT\System32
Cablib.dll: you will found this in WSP tools folder which you downloaded


We have two Scenarios from here
1) No DLL’s
2) Are we having any DLL’s to be dropped in GAC?

If we are not Deploying any DLL’s into GAC just click on the WSPBuilder.exe.
This Generates 2 files.
1) solutionid.txt
2) WSP file (EX: ArtCoreFeatures.wsp)


If we are having DLL’s to be deployed in to GAC in part of WSP.
a) Drop the Dll’s in to the Release folder of the Project.
b) We have to write a manifest file.
This says what are the dll’s to be deployed into the GAC.
The manifest file contains SolutionID attribute which specifies the unique GUID assigned to the solution.
The manifest file is an xml file. Looks like the below.(Remove the - in the tags)
<-Solution SolutionId="63DD8533-9BAF-4ca8-8EFE-0846F0CD3CC1" xmlns="http://schemas.microsoft.com/sharepoint/">
<-FeatureManifests>
<-FeatureManifest Location="CreateProjectWorkSpace\feature.xml" />
<-/FeatureManifests>
<-TemplateFiles>
<-/TemplateFiles>
<-Assemblies>
<-Assembly DeploymentTarget="GlobalAssemblyCache" Location="ArtCoreFeatures.dll" />
<-Assembly DeploymentTarget="GlobalAssemblyCache" Location="Microsoft.EDD.ArtCore.GenericWorkflowWF.dll" />
<-Assembly DeploymentTarget="GlobalAssemblyCache" Location="CreateProjectWorkSpace.dll" />
<-/Assemblies>
<-/Assemblies>
<-/Solution>
After making necessary modifications place this manifest file in the Step6 folder structure. And click on WSPBuilder.exe.
This packs the Dll’s .

3 comments:

Naveed said...

Excelent Post.Keep it up....

Praba said...

Nice one, Thanks :)

Harshaa Annadurai said...

Wonderful, simple and to the point, appreciated.