Running Tarantino With MSBuild

To set up Tarantino to run you follow the instructions from my last couple of posts.  Once you've done that, you set up a file to run the project.

This is how you set up your folder structure.

 Tarantino_FolderStructure

Under db are two folders, Create and Update. In MSBuild, all of the required files to run, plus my MSBuild file (tarantino.proj).

Here is how you set up a batch file to call MSBuild to run your database updates. This file is named dbdeploy.bat.

@echo on

SET DIR=%~d0%~p0%

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\msbuild.exe "%DIR%msbuild\tarantino.proj" /t:default

pause

I included another file called dbdeploy.Create.bat to show how I override a property.

@echo on

SET DbAction=Create

SET DIR=%~d0%~p0%

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\msbuild.exe "%DIR%msbuild\tarantino.proj" /t:default /p:DbAction=%DbAction%

pause

Here's the contents of the tarantino.proj file

Update ..\\db . test And the contents of the tarantino.targets file. Very small and to the point. It gives me the ability to make the call to ManageSqlDatabaseTask above. Here's a picture of the run. Isn't it pretty? :D [![Tarantino\_MSBuild](/images/robz/running-tarantino-with-msbuild/c8d5b14a-Tarantino_MSBuild_thumb_1.jpg)](/images/robz/running-tarantino-with-msbuild/14152a42-Tarantino_MSBuild_4.jpg) But what is reading versus trying? Download the code below and try this out for yourself! **Update:** I caught a small annoyance that occurs if you call msbuild and the path to the .proj has spaces in it (like C:\\Documents and Settings\\). When you download, surround the path in quotes (C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\msbuild.exe **"**%DIR%msbuild\\tarantino.proj**"** /t:default). **Update (29 MAR 2009)**: I fixed the download to have that path in it. [![kick it on DotNetKicks.com](http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fferventcoder.com%2farchive%2f2009%2f03%2f25%2frunning-tarantino-with-msbuild.aspx)](http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fferventcoder.com%2farchive%2f2009%2f03%2f25%2frunning-tarantino-with-msbuild.aspx)
This article is part of the GWB Archives. Original Author: Robz / Fervent Coder

New on Geeks with Blogs