A .wsp file is a deployable, reusable package that contains a set of features, site definitions, and assemblies that you can apply to a SharePoint site and can activate/deactivate individually on your own discretion. MOSS provides a way to bundle all of the components called a solution file which is a cabinet or .CAB-based format with a .WSP extension. A .wsp file can be used to deploy a Web Part, features and other package components to a SharePoint site/site collection/web application/farm. In this post we will see how can we create a .wsp file manually.
When you package a webpart in Sharepoint, it creates a .wsp file and we use this .wsp file to deploy on Sharepoint server. With MOSS 2010, Microsoft have eased the process of packaging webparts. You can right click on Project in solution Explorer and click “Package”, the solution gets packaged and a brand new .wsp file gets generated. However, what if we need to build a .wsp file manually or we need to know what is happening behind the scenes when the packaging this done. This post describes it here… We will be creating a new .wsp file from scratch without using Visual Studio and any 3rd party tools.
For creating the .wsp file, what you need is the .dll file of the webpart and all other custom files(JS, CSS, images) required in your web part. So, let’s start creating a .wsp file. Firstly, we will create a directory structure as below:
- The top level folder name can be anything, I named it TestSolution
- The bin folder is the location where the .wsp file will be created
- The SPWebPart folder is where we will be keeping all our required files. For ease, I have mapped this name to my webpart project name in Visual Studio.
.stp File Content. A.stp file is just a.cab archive (similar to a.wsp) and, after changing the file’s extension to cab, it can be opened and viewed with any popular archiver (WinRar, 7 zip and so on). In the.cab you’ll see at least one file, manifest.xml (frequently, there is nothing but the one).
- WPS Office for Windows. WPS Office for Mac. PDF Converter Pro For Android.
- PDF Converter Pro For Android. WPS Fill & Sign For Android.
- Wsp Office free download - Microsoft Office Outlook 2007, Microsoft Office 2010, WPS Office Premium, and many more programs.
Now, we will create 2 folders in our SPWebPart folder, one for the feature and another for the 12/14 HIVES where Sharepoint stores our custom JS, CSS and images. Please note that the name of folders added here should match the feature name from Visual Studio. Also, since we map the Layouts folder from HIVES in Sudio, we have added the Layouts folder. Also, add another folder inside Layouts with the Project name and a folder with WebPart’s name under the Feature folder. Now the file structure will look something like below:
Now,
- Copy the .dll file of the project in TestSolutionSPWebPart
- Copy all JS,CSS, images file in TestSolutionSPWebPartLayoutsSPWebPart
- Copy the .webpart from Visual Studio to TestSolutionSPWebPartSPWebPart1_FeatureWebPart1
- Create a new Feature.xml file in your favorite editor. Store the file in TestSolutionSPWebPartSPWebPart1_Feature The feature.xml file will look as below, please note that you will need to change the webpart name, if you have it different.
After you have created the Feature.xml file, we need to create a Elements.xml file for the webpart. So, create another file “Elements.xml” in your editor and store it in TestSolutionSPWebPartSPWebPart1_FeatureWebPart1 The file will look as below:
Now, you need to create final XML file named manifest.xml that will be entry point. So, create a new manifest.xml file and store it in TestSolutionSPWebPart
The file will look like below:
You can add all the file references under “TemplateFiles” section as mentioned above.
So, now we have everything ready to create a .wsp file. The final step before creating a .wsp file is to create a .ddf (Data Definition File) which will be required by the Makecab utility. Create a .ddf file in an editor and name it wsp.ddf The ddf file will look as below:
Finally, open DOS Prompt and execute the following command:
makecab f wsp.ddf
After you have executed the command, you will see a SPWebPart.wsp file present in TestSolutionbin folder.
Please let me know your feedbakc via Comments..
Unfortunately, SharePoint 2007 site templates(.stp) can't be used as in SharePoint 2010. Hmm... Then what to do with the custom SharePoint 2007 Site templates? Can't I use them in SharePoint 2010? well, You can, Here is the work around to Migrating MOSS 2007 Site, List Templates(.stp) to SharePoint 2010:
- Create a site in SharePoint 2007 using the custom .stp template.
- Migrate that site to SharePoint 2010 by either In-Place or Database attach method (backup the database for that site from SQL Server for SharePoint 2007 and restore it on SharePoint 2010's SQL Server, then atach the DB(stsadm -o addcontentdb) to SharePoint 2010)
- After you do that just Open up the site and fix any issues (like file system references).
- Once upgraded to SharePoint 2010, follow these steps:
- Click on Site Actions >> Site Settings.
- On the Site Settings page click 'Save site as Template', then enter a file name and Template name and click OK.
- Now, The site template is saved as a WSP file to the Solutions Gallery for that site collection. This solution can then be re-used as a Site Template.
Open the .wsp solution in Visual studio 2010, change the Scope to “Farm” and re-deploy, if you want this site template to be available at the farm level.
![Download Convert Stp To Wsp For Windows 10oikos Download Convert Stp To Wsp For Windows 10oikos](/uploads/1/3/7/4/137448419/235324605.jpg)
Important: When saving site as a template enable 'Include Content' check box! otherwise you may end up in Error: Exception from HRESULT: 0x81070905' when creating sites from the particular template.
Migrating List Templates from MOSS 2007 to SharePoint 2010
Likewise, List templates created in MOSS 2007 can't be used in SharePoint 2010. You will get this error when you try to create a list based on MOSS 2007's List template:
Error: Microsoft SharePoint Foundation version 3 templates are not supported in this version of the product!
Fortunately, There is a work around. We can use the same method as above. Or if its just a list template, we can use the below trick:
- Download the .STP file from the site, and Rename .STP to .CAB
- Extract the manifest.xml
- In 'ProductVersion' element, Change its value to from '3' to '4'
- Repackage the manifest.xml into a .CAB. makecab.exe c:manifest.xml c:template.cab
- Rename the .cab file from .CAB to .STP and upload it into the List templates (_catalogs/lt)
Download Convert Stp To Wsp For Windows 10 Oikos Word
Here is a scripted way: http://www.heyweb.net/2011/06/converting-sharepoint-2007-document-library-templates-for-sharepoint-2010/Download Convert Stp To Wsp For Windows 10 Oikos Yogurt
Read more: http://www.sharepointdiary.com/2011/09/migrating-sharepoint-2007-site-list-templates-to-sharepoint-2010.html#ixzz3ShG70zax