Udostępnij za pośrednictwem


How to: Configure Build Settings for Database and Server Projects

You can customize how a database project builds by specifying settings for each solution configuration. For example, you can specify whether a database project should continue to build if a warning occurs. You can also specify what the name and path of the built schema (.dbschema) should be so that you can later deploy that schema to any target server and database. If you have related projects, you can specify in which order they build. For example, you must build a database project before you build any projects that contain unit tests for that database. For more information about how to configure builds, see How to: Create and Edit Configurations.

To configure build settings for a database project

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

  2. On the Project menu, click ProjectName Properties, where ProjectName is the name of your database project.

    The properties for your database project appear.

  3. Click the Build tab.

  4. In the Configuration list, click the configuration that you want to customize.

    In the Platform list, accept the default value.

  5. In Build output path, type the path where you want the schema file to be created when you build the project.

    You can also click Browse to specify a path.

  6. In Build output file name, type the name that you want to give the compiled schema file when you build the project.

  7. If you want the build to stop when a warning is encountered, select the Treat warnings as errors check box. If you want the build to stop for an error but continue when a warning is encountered (the default value), clear the Treat warnings as errors check box.

  8. (optional) If you want to suppress one or more warnings, type a list of warning numbers, and delimit it by using commas or semi-colons.

  9. On the File menu, click Save Selected Items.

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

  1. In Solution Explorer, click the project that contains database unit tests for a database 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 unit tests will run.

    Note

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

  4. Click OK.

    Your database project will now be built before the project for your database unit tests when you build your solution.

See Also

Tasks

How to: Create and Edit Configurations

How to: Create and Remove Project Dependencies

How to: Prepare and Manage Builds

How to: Prepare Database Build Scripts

Concepts

Build Configurations

Terminology Overview of Database Edition

Build and Deploy Databases to an Isolated Development Environment

Build and Deploy Databases to a Staging or Production Environment