Plunging into .NET Development

Weblog Pieter Gheysens
Microsoft .NET Development - C# - Enterprise Library - Visual Studio 2005 Team System - Compuware DevPartner - ...
 


Sunday, December 23

Default Team Build Failure with DBPro project

Building a default Team Build with an included DBPro project in the solution will fail by default in Visual Studio 2005 Team System and in Visual Studio 2008 Team System. This is quite frustrating and it's really a pity that Microsoft let us down here. Of course, there is a workaround, but it requires a few manual steps before you get it rolling and it spoils the out-of-the-box experience!

Last friday, my colleague Thomas Annerel (who still hasn't a blog ;-)) and I did a presentation for the VISUG on Visual Studio Team System 2008 Database Edition. We announced there that we would put the workaround for the Team Build online ...

Here's a brief summary of what you need to do:
  • Create a new build definition with a Default configuration
    The only listed configuration options are Debug and Release but Database projects do not define these kind of configurations, so you need to manually set the Default configuration.



  • Copy elements DefaultDataPath, TargetConnectionString and TargetDatabase from the .dbproj.user file on your local file system and enter these elements at the appropriate locations in the .dbproj file.



    Non-default values for the DefaultDataPath, TargetConnectionString, and TargetDatabase properties are stored in the .dbproj.user file which is not under source control and won't be available for a Team Build. You need to enter these elements in the .dbproj file. By default you will see an undefined entry for the DefaultDataPath property and an empty element for the TargetConnectionString property and the TargetDatabase property in the .dbproj file.

  • Override one of the standard Team Build targets to add a custom task to Team Build and set the SQLDeploy target.



    I have chosen to override the BeforeTest task, so I will also be able to run my Database UnitTests on the database that gets deployed with this custom task.
These custom actions should do it! Be aware that the account that's running Team Build (Team Build service account) on the Build Server should have the desired permissions to deploy a database on the target database server - otherwise you will run into a DesignDatabaseFailedException (insufficient permissions to create the database project).

Note : slides from our presentation will become available shortly on the VISUG website!

Labels: ,

0 Comments:

Post a Comment

<< Home