Export (0) Print
Expand All

How to: Configure Database Projects for Build and Deployment

Visual Studio 2005

You control how your database is built and deployed by using project properties. Project properties include general settings such as the project version, default schema, and default collation in addition to build settings such as configuration, platform, target database, and so on.

To configure general properties for your database project

  1. In Solution Explorer, click the database project for which you want to configure properties.

  2. On the View menu, click Property Pages. You can also click ProjectName Properties on the Project menu.

    The properties sheet for your database project appears.

    NoteNote

    You can also right-click the database project and click Properties.

  3. Click the Project Settings tab.

    You can now configure your database project properties. For information about the settings that you can configure, see An Overview of Database Project Settings.

To configure build properties for your database project

  1. In Solution Explorer, click the database project for which you want to configure properties.

  2. On the View menu, click Property Pages. You can also click ProjectName Properties on the Project menu.

    The properties sheet for your database project appears.

    NoteNote

    You can also right-click the database project and click Properties.

  3. Click the Build tab.

    You can now configure your database project properties. For information about the settings that you can configure, see An Overview of Database Project Settings.

Choosing a Build Configuration

You can choose a build configuration for each database project in your solution. By default there is a single configuration, but you can add custom configurations. You might choose to do this, for example, if you wanted a custom configuration in which you always deleted and re-created the database. In solutions that contain different project types, you can create a custom solution configuration that contains a particular build configuration for each project.

To specify a build configuration for your database project

  1. In Solution Explorer, click the database project for which you want specify a build configuration.

  2. In Solution Configurations on the Standard toolbar, click the build configuration that you want to use for your database project.

    The new configuration is now selected. If you build the project, the configuration that you clicked will be used.

To specify a build configuration for your solution

  1. In Solution Explorer, click the solution node.

  2. On the Build menu, click Configuration Manager.

    The Configuration Manager dialog box appears.

  3. Specify the configuration settings that you want to use for each project in your solution. For more information, see How to: Prepare and Manage Builds.

Specifying Build Order

You must build the projects in your solution in the correct order if your solution contains both a database project and one or more database unit test projects for that database project. The database project must be built before the database unit test projects.

To specify a dependency between a database unit test project and its database project

  1. In Solution Explorer, click the database unit test project.

  2. On the Project menu, click Project Dependencies.

    The Project Dependencies dialog box appears.

  3. In Depends On, click the database project on which the database unit test project depends.

    NoteNote

    You can verify the project build order by clicking the Build Order tab in the Project Dependencies dialog box.

  4. Click OK.

    Your database project will now be built before your database unit test project when you build your solution.

See Also

Show:
© 2014 Microsoft