How to: Distribute Custom Feature Extensions to Team Members

After you have created a custom extension .dll assembly and an .Extensions.xml file, you can distribute them to team members by using a Setup Wizard project. The setup project will put the assembly and the XML file into a user's [Program Files]\Microsoft Visual Studio 9.0\VSTSDB\Extensions\CustomExtensions folder. This will make it easier to install and register the custom extension on a target user's computer. For more information, see How to: Register Custom Generators.

To create a deployment project

  1. Open an existing database extensibility project.

  2. On the File menu, point to Add, and then click New Project.

    The New Project dialog box opens.

  3. Expand the Other Project Types node, point to Setup and Deployment, and then click Setup Wizard. Name the project DataBaseExtensionsSetup, and click OK.

  4. Proceed through the first page of the Setup wizard by clicking Next.

  5. On the second page of the wizard, click Create a setup for a Windows application, and then click Next.

  6. On the third page of the wizard, click Primary Output from <database extensibility project name>, and then click Next.

  7. On the fourth page of the wizard, click Add. Browse to the <database extensibility project name>.Extensions.xml file that you created to register your custom data generator, and then click Open.

  8. Click Finish.

    Your deployment project has been created.

Creating a Custom Folder

You must now create folders in your deployment project that represent the folders where your custom extension .dll and .Extensions.xml file will be copied.

To create a custom folder

  1. In the deployment project, click the File System tab to specify the file system editor if it is not already specified.

  2. Right-click in the white space in the leftmost pane of the file system editor, point to Add Special Folder, and then click Custom Folder.

  3. Type Custom Extensions as the name for the new folder.

  4. In the file system editor, click the custom folder. In the Properties window, set the DefaultLocation property of the folder to [ProgramFilesFolder].

  5. In the Properties window, append the following to [ProgramFilesFolder]:

    \Microsoft Visual Studio 9.0\VSTSDB\Extensions
    

    So the resulting property value should be:

    [ProgramFilesFolder] \Microsoft Visual Studio 9.0\VSTSDB\Extensions
    

    Tip

    A best practice is to put your extension assemblies in a folder in the <Microsoft Visual Studio 9.0>\VSTSDB\Extensions directory. This will help you identify which extensions were included with the product, and which ones are your custom creations. Folders are also recommended for organizing your extensions into specific categories.

  6. In the leftmost pane of the file system editor, click Application Folder. Right-click the <database extensibility project name>.Extensions.xml file, and then click Cut.

  7. In the leftmost pane of the file system editor, right-click the Custom Extensions folder you created, and then click Paste.

    The <database extensibility project name>.Extensions.xml file is deployed in the directory location that is specified for this custom folder.

  8. In the leftmost pane of the file system editor, click Application Folder. Right-click the Primary output from the <database extensibility project name> file, and then click Cut.

  9. In the leftmost pane of the file system editor, right-click the Custom Extensions folder, and then click Paste.

    The primary output from your database extensibility project is deployed in the directory location that is specified for this custom folder.

Building the Deployment Project

You will now build the deployment project, which you can then run to install the custom database extension on any computer on which you have installed Visual Studio Team System Database Edition.

To build the deployment project

  1. On the Build menu, click Configuration Manager, and make sure that the Build check box is selected for all projects.

  2. On the Build menu, click Build Solution to build the solution.

    Your deployment project is now built and ready to install.

See Also

Concepts

Extending the Features of Database Edition

Create Custom Database Refactoring Types or Targets

Create and Register Additional Rules for Analyzing Database Code

Generate Specialized Test Data with a Custom Data Generator

Define Custom Conditions for Database Unit Tests

Other Resources

How to: Register Custom Generators