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
In Solution Explorer, click the database project for which you want to configure settings.
On the Project menu, click ProjectName Properties, where ProjectName is the name of your database project.
The properties for your database project appear.
Click the Build tab.
In the Configuration list, click the configuration that you want to customize.
In the Platform list, accept the default value.
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.
In Build output file name, type the name that you want to give the compiled schema file when you build the project.
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.
(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.
On the File menu, click Save Selected Items.
To specify a dependency between a database unit test project and its database project
In Solution Explorer, click the project that contains database unit tests for a database project.
On the Project menu, click Project Dependencies.
The Project Dependencies dialog box appears.
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.
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: Build a Database Project to Generate a Compiled Schema (.dbschema) File
Concepts
Build and Deploy Databases to an Isolated Development Environment
Build and Deploy Databases to a Staging or Production Environment