
Modify the Database Project File
The target connection and database are stored in the ProjectName.dbproj.user file, which is user specific and not typically checked in to version control. You require those settings to deploy your database. Therefore, you must modify the ProjectName.dbproj file manually to specify the target connection and database.
To modify the database project file
Check the ProjectName.dbproj file out from your version control system.
On the File menu, click Close Solution. This step is necessary because you cannot modify a project file that is in an open solution.
On the File menu, point to Open, and click File.
Browse to the folder that contains the database project file (ProjectName.dbproj), and double-click ProjectName.dbproj.user.
Copy the lines that contain the definitions for the TargetDatabase and TargetConnectionString properties from the section in the ProjectName.dbproj.user file for the configuration that you want to build. These lines will resemble the following:
<TargetDatabase>MyTargetDatabaseName</TargetDatabase>
<TargetConnectionString>Data Source=ServerName\InstanceName;Integrated Security=True;Pooling=False</TargetConnectionString>
Note: |
|---|
The name of the database project is used if you do not specify the name of a target database.
|
Copy those two entries to the Clipboard.
On the File menu, point to Open, and click File.
Browse to the folder that contains the database project file (ProjectName.dbproj), and double-click ProjectName.dbproj.
Scroll down to the PropertyGroup for the configuration that you want to deploy using Team Foundation Build.
Paste the entries that you copied to the Clipboard into the project file. If TargetDatabase and TargetConnectionString already contain empty elements, you should overwrite those entries.
On the File menu, click Save ProjectName.dbproj.