​​This is a simple example of creating a Web Part in Visual Studio 2008 using WSPBuilder. In our example, we are building a solution named "Demo", substitute your solution name where appropriate. Download WSPBuilder before starting.
  • Open Visual Studio 2008.
  • Verify the WSPBuilder add-in is activated:
    • Click Tools|Add-in Manager.
    • In the Add-in Manager dialog window, under Available Add-ins, check "WSPBuilder".
    • Check Startup on the same line and click OK.
  • Click File|New Project...
  • In the New Project dialog window, under Project Types, expand Visual C# and click WSPBuilder.
  • Under Templates, click WSPBuilder Project.
  • Under Name, type the name of your Solution (Example: "Demo"). The Solution Name field will be replaced with the Name you entered.
  • Under Location, select your folder for Web Parts (Example: "C:\Projects\Web Parts​").
  • Ensure "Create directory for solution" is checked and click OK.
  • In the Solution Explorer pane, verify your solution "Demo" was created, with the project "Demo".
  • ​In the Solution Explorer pane, right-click the project node ​and click Properties. This will open the Properties pane, and is NOT the same as the Properties pane you see by clicking F4.
  • In the Demo Properties pane, the first tab is Applications. Under Default namespace, enter the namespace you will use for all Web Parts in this solution. Every class you create will inherit the default namespace, so you should name it before creating any classes (Example: Demo.WebParts).
  • Click the Signing tab, verify Sign the assembly is checked. By default, the strong name key file will be the same as your assembly/solution (Example: Demo.snk). You must use strongly-named classes in SharePoint solutions, as well as any DLL libraries you create.
  • Click File|Save All or Ctrl+Shift+S. You must save all when updating the Properties panel, to ensure all tabs are saved.
  • We will now create the Web Part Feature, WSPBuilder will create several XML and CS classes in this step.
  • Note:​ If you are only going to have one Web Part deployed with your Site Collection Feature, you can give the feature the same name as the Web Part. However, in this example we are building a feature that will eventually have more than one Web Part, so we are doing things a little different.
    • In the Solution Explorer pane, right-click the project node and click Add|New Item...
    • In the Add New Item - Demo dialog window, under Categories click WSPBuilder.
    • Under Templates, click Web Part.
    • Under Name, enter the name of your Web Part Feature (Example: DemoWebParts). Click Add.
    • Note: It is good practice to create classes without spaces, and change the title later. This makes it easier to write code to reference objects without worrying about converting spaces.
    • In the WebPart Wizard dialog window, the Feature panel is displayed. Enter "Demo Web Parts" for the Title, "Sample Web Parts for Demo." for Description, and select "Site" for Scope. Uncheck Event handler. Click Next.
    • Note: The Title and Description will be displayed on the Site Collection Features page on your SharePoint site. You will have an opportunity to change these values in the XML file later. Also, note that Web Parts must be deployed at the Site (Site Collection) level, while Event Handlers are deployed at the Web (Site) level. See Scope for an explanation of the different levels of Scope.
    • In the WebPart Wizard dialog window, the Web Part panel is now displayed. Enter "MyLinks" for the Title, "Displays  Links in a new window." for Description. Leave Removal code checked. Click Finish.
  • In the​ Solution Explorer pane,​ verify that a new set of folders has been created: SharePointRoot|Template|Features|DemoWebParts.​