Running the Sample Tools

In this article
Editing the Registry File
Build the Project and Copy the Files
Creating the Workspace and Adding the Tools

This section describes how to run an add-in tool built from one of the SDK samples or from the template.

Editing the Registry File

Before building the project, you should edit the registry file to specify the location where you will install the tool assembly and manifest. In the PhotosWPF sample project, RegisterAddIn.reg contains the following line:

"ManifestPath"="c:\\SPWAddins\\PhotosWPF"

The QuerySample and AttachmentsAndConflicts samples are similar with the project name replacing "PhotosWPF". In projects created from the template, RegisterAddIn.reg contains the following line:

"ManifestPath"="c:\\Your_Install_Location\\project-name

In all cases, you should edit this line so that the ManifestPath points to the location where the tool assemblies and manifest will be installed.

Build the Project and Copy the Files

Before building the project, you should check that the references to the SharePoint Workspace libraries are correct in the project. The references to the libraries are relative paths and they may not match the location of the libraries on the system. If the icon in front of any of the following references has an exclamation mark, you have to remove and then re-add the reference:

  • Microsoft.Office.SharePointWorkspace.AddIn

  • Microsoft.Office.SharePointWorkspace.AddIn.Data

  • Microsoft.Office.SharePointWorkspace.AddIn.Tool

To remove the reference in Visual Studio 2008, right-click the reference and select Remove. To add the reference, do the following:

  1. Right-click References and select Add Reference ....

  2. Select the Browse tab and locate the Office 2010 binaries. If you installed Office 2010 in the default location, the binaries are in one of the following folders:

    • C:\Program Files\Microsoft Office\Office14

    • C:\Program Files (x86)\Microsoft Office\Office14

  3. Add references to the following libraries:

    • microsoft.office.sharepointworkspace.addin.Interface.dll

    • microsoft.office.sharepointworkspace.addin.Data.dll

    • microsoft.office.sharepointworkspace.addin.Tool.dll

You can either use a debug or a release configuration for the project. When you build the project, you may get a warning that the .csproj file cannot be saved because it is write-protected. If you get this message, select Overwrite to continue the build.

Once you have built the project, copy the files listed for each sample from the bin\debug or bin\release folder to the folder that is specified in the ManifestPath.

  • QuerySample:

    • QuerySample.dll

    • QuerySample.pdb (optional)

    • spwaddin.xml

    • RegisterAddIn.reg

    • SampleData.xml

  • PhotosWPF:

    • PhotosWPF.dll

    • PhotosWPF.pdb (optional)

    • spwaddin.xml

    • RegisterAddIn.reg

  • AttachmentsAndConflicts:

    • AttachmentsAndConflicts.dll

    • AttachmentsAndConflicts.pdb (optional)

    • spwaddin.xml

    • RegisterAddIn.reg

  • New project from template:

    • project-name.dll

    • project-name.pdb (optional)

    • spwaddin.xml

    • RegisterAddIn.reg

Creating the Workspace and Adding the Tools

To create a Groove workspace with an add-in tool, you should do the following:

  1. Execute the registry file for the add-in tool that you will be adding to the workspace. You have to execute the registry file one time on each system that will have the workspace.

  2. Create a Groove workspace. You should accept the default workspace version, which is 2010.

  3. On the Workspace tab in the Ribbon, select Add Tool and then select the add-in.

  4. Invite the other members to the workspace.

Note

If you are running in a Windows on Windows (WOW) environment, where you have the 64-bit version of the operating system, but are running a 32-bit version of SharePoint Workspace, you must execute the registry file by using the SysWOW64 version of the registry editor. If you have installed the operating system in the c:\Windows folder, you can run the SysWOW64 version of regedit, by entering the following:

c:\Windows\SysWOW64\regedit

Then use Import in the File menu to execute the registry file. This adds the add-in keys to the following location in the registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\Groove\AddIns

If you double-click the .reg file, it invokes the 64-bit registry editor and puts the keys in the following location that can be accessed by the 64-bit SharePoint Workspace:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\Groove\AddIns

The 32-bit SharePoint Workspace cannot access the keys in this location when it is running on a 64-bit operating system.