Developing SharePoint Solutions in Visual Studio Using WSPBuilder

  • November 18, 2009
  • By Charles Lee
  • Charles
  • More Articles »
a. The 12 folder representing the 12 Hive (located at C:\Program Files\Common Files\Microsoft Shared\web server extensions\12)

b. The 80 folder representing the virtual directory folder

c. The _Resources folder contains the .snk file and can be used for other assembly resources if required.

d. The _Business Logic folder contains all your classes and custom code.

For our needs we want to deploy a feature, so:
7. Open the 12 > TEMPLATE > FEATURES folder.

8. Rename the folder called ‘FeatureName(Rename)’ to ‘WSPBuilderLink’

9. Your folder structure should now look like this:

10. Open the feature.xml file. You will see that this has been configured for a standard feature using a single elements.xml file. You can obviously configure this as you wish.

We need to replace the [GUID] with a newly created and unique GUID. In SharePoint development this is a common task and it is beneficial to add an option to the tools menu to do this for you.
11. In Visual Studio 2008 select Tools > External Tools.

12. Click Add and update the dialog as follows:

a. Title: Create GUID

b. Command: C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\guidgen.exe

13. You should now be able to select Tools > Create GUID.

14. Select 4. Registry Format from the GUID Format list.

15. Click Copy and then Click Exit. This will copy your new GUID to the clipboard.

16. In your feature.xml file highlight [GUID] and press cntrl + V (or Edit > Paste) to copy your new GUID into this file. Don’t forget to delete the braces ({ }) as these are not required in this file.

17. Update your feature.xml with an appropriate Title and Description.

18. Replace [Scope] with ‘Web’ as we want this link on the Site Actions menu for a given web only.

19. Save your feature.xml file, it should now look something like this:

20. Open the elements.xml file. Again this has been pre-configured for a sample CustomAction in this case a simple web link.

21. Change the Id,Title and Description to something sensible and unique.

22. The UrlAction element identifies which URL this custom action is going to redirect to. Amend the Url attribute to redirect to “http://msdn.microsoft.com/en-us/sharepoint”

23. Save your elements.xml file, it should now look something like this:

24. Your very simple WSP file is now ready to be packaged up for deployment. Press Cntrl + Shift + B to build your project.

123


Networking Solutions







Partners