Building a Solution Package (.wsp):-
1.First we need to create new solution in that create proper folder structure and which artifacts we need to deploy that all like Webparts ,Event handlers,Workflows,features etc these all r u will get dll that all u can add to the solution.
2. Add new item i.e manifest.xml. in this xml according to our requirement we need to write the code
Sample code :
<?xml version="1.0" encoding="utf-8"?>
<Solution xmlns="http://schemas.microsoft.com/sharepoint/"
SolutionId="EC2EFD73-DBA2-4c0e-9C18-C8FC43F72E6C" >
<FeatureManifests>
<FeatureManifest Location="MyList\Feature.xml"/>
</FeatureManifests>
<Assemblies>
<Assembly DeploymentTarget="[WebApplication | GlobalAssemblyCache]" Location="webpart1.dll"></Assembly>
</Assemblies>
</Solution>
3. Add a new text file extension with ddf (data definition file) in this some default code we need to write.
Sample ddf file code:
OPTION EXPLICIT ; Generate errors
.Set CabinetNameTemplate=SampleCab.wsp
.set DiskDirectoryTemplate=CDROM ; All cabinets go in a single
directory
.Set CompressionType=MSZIP;** All files are compressed in cabinet files
.Set UniqueFiles="OFF"
.Set Cabinet=on
.Set DiskDirectory1=SAMPLECAB.wsp
manifest.xml
WebPart1.dwp
4. Open a command prompt, change to the directory that contains the .ddf file and the files that you want to include in the .cab file, and then run the following command:
Makecab.exe /F sample.ddf
5.Now we will get WSP in solution explore with new folder called Package.
6.Move to this wsp to production central admin server.
7.run the stsadm command to deploy this solution.
stsadm.exe -o addsolution -filename MyListSolution.wsp
stsadm.exe -o deploysolution -name MyListSolution.wsp -local
if you want retract or delete the solution
run these commands.
stsadm.exe -o retractsolution -name MyListSolution.wsp –local
stsadm.exe -o deletesolution -name MyListSolution.wsp
-> After the solution is deployed you can activate the feature in the Site features menu of you site



No comments:
Post a Comment