By Edith C
Building a SharePoint solution can be a mess, but using this tool, the process becomes very easy and intuitive.
Feature creation
Prerequisites:
· Install WSP Builder tool
1. Create a new project on Visual Studio (i.e. Feeds)

2. Add a new item on the project, right clicking Project Name, Add… New Item… WSP Builder Templates, select Web Part Feature set a name for it (i.e. Feeds), and click Add.

3. Set the name and description of the new feature, and set the scope: Web, Site, WebApplication or Farm. Click OK.

4. Your feature its created, and the generated files are:
· 12/TEMPLATE/FEATURES/Feeds folder (this is the structure for the SharePoint core folders)
o elements.xml
§ Specifies a support file required for the Feature. In this case, the file required is Feeds.webpart

o feature.xml
§ Defines a Feature to activate or deactivate at a specified scope. In this case, the feature its

o Feeds.webpart

· WebPartCode folder
o Feeds.cs
5. Create the folders: UserCode at Root, and CONTROLTEMPLATES/SIEENA at 12/TEMPLATE. Now add a WebUserControl inside SIEENA folder. Now you have the following structure:

6. Rename your control and move the ascx.cs file to UserCode folder. Remove the CodeFile=”” property from your acsx file, and replace it by the Inherits=”” property, setting this to the “UserCodeNamespace.NameOfYourControl, DLLName, Version, Culture, PublicKeyToken” (you can take the version, culture and token from the .webpart file) like this:

7. Change the namespace of your WebPartCode files (Feeds.cs) and finally merge this two namespaces (WebPartCode and UserCode) into your .webpart file(name=”WebPartCodeNamespace.WebPartName, DLLName (same as ascx), Version, Culture, PublicKeyToken”) like this:


8. Add the following code to your Feeds.cs WebPart code, to load your web control when the webpart renders:

9. You can start adding code to your ascx and ascx.cs files.
Add and Deploy solution
1. Build your project with your normal VS tool.
2. Build your project using the external tool WSPBuilder, right clicking the Project, WSP Builder, Build WSP.

3. All you need to do is deploy this webpart to your site. WSP Builder tool provides you with shortcuts to deploy this file directly from VS, if you are on the same deployment server. So if this is your case, you can go and right click on your project > WSP Builder > Deploy (this will deploy your solution to the scope you selected, and it will place your assemblies into the GAC). Then right click on your project, WSP Builder, copy to 12 hive (this will copy your ascx controls and your xml files to SharePoint core files).
4. If you are deploying manually, you need to copy the WSP file to your deployment server.
5. Copy your WSP file to C:\Program Files\Common Files\microsoft shared\Web Server Extensions\12\BIN folder. Run the stsadm tool, and type: stsadm -o addsolution -filename {WSPFILENAME}

6. Then type: stsadm –o deploysolution – name {WSPFILENAME} –url “{URL with port}” –immediate –allowgacdeployment

7. Now you can go to your Site, Site Settings, Site Collection Features, and search for your feature.

8. Click on Activate button.
9. You can now add all the web parts contained on your feature.

Hope you enjoyed this week's blog post about SharePoint.
Edith C.