Click here to Skip to main content
15,663,557 members
Articles / Web Development / ASP.NET
Posted 3 Apr 2010

Tagged as


51 bookmarked

Automate Builds using SVN, MSBuild, Cruise Control

Rate me:
Please Sign up or sign in to vote.
4.50/5 (7 votes)
5 Apr 2010CPOL1 min read
This tutorial explains how to automate the build with the help of SVN, MSBuild and Cruise control


This article will explain how to use SVN, MSBuild, Cruise control and CCtray to automate the build process.


msbuild document is used to build the .NET solution file. Below is the snapshot of the msbuild document.

It starts with tag Project and we must have to import the msbuild path installed on our local system.

There are Target tags (can be more than one) and we can give them any name. The compiler will search for the tag Build and starts with that tag. Before that, it will go through the tags specified in DependsOnTarget.


Code Snap of msbuild.xml

Below is the code snippet displayed in the image to copy in your application.

<Project DefaultTargets="Build" 
    <Import Project=
      "C:\Program Files\MSBuild\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>

    <Target Name="GetSource">
            <Message Text="Checking out trunk into $(SourceDirectory)" />
            <SvnCheckout RepositoryPath="PATH TO SVN" 
                LocalPath="LOCAL PATH TO FOLDER"
                UserName="USERNAME OF SVN"
                Password="PASSWORD OF SVN">
                <Output TaskParameter="Revision" PropertyName="Revision" />
            <Message Text="Have got revision: $(Revision)"/>

    <Target Name="Build" DependsOnTargets="GetSource;Clean;" />
    <Target Name="Clean">
        <!-- Clean, then rebuild entire solution -->
        <MSBuild Projects="D:\Projects\SOLUTIONFILENAME.sln" Targets="Clean;Rebuild" /> 


Configure Cruise Control

Now go to “C:\Program Files\CruiseControl.NET\server” and open “ ccnet.config


<project name="YOURPROJECTNAME">

            <intervalTrigger seconds="14400" buildCondition="ForceBuild" />

                <workingDirectory>PATH OF WORKING DIRECTORY</workingDirectory>        
                <!--  30 minutes -->
                <logger>C:\Program Files\CruiseControl.NET\server\

Now, configure the cc tray by passing the SERVERIPADDRESS as above XML document and click on build. If build is successful, then it will show a green symbol otherwise it will show a red symbol.

Configure CCTray

Step 1

go to File - >Settings


Step 2

Then in Build project tab, click on Add button.


Step 3

After that, click on Add Server button.


Step 4

Then in URL part, type the IP address of the server or localhost on which the ccnet is installed.


Step 5

When server is added, all the projects added in the configuration file will be displayed on the right side panel. Click on project to add in cctray.


In the next tutorial, I will discuss how to send email through ccnet and how to configure the web dashboard of ccnet.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Written By
Software Developer (Senior) Cognizant Technology Solutions
India India
Having more than 9 years of experience in Programming and web application development.

Writing technical blog articles, learning new Programming languages , frameworks and sharing knowledge with others is one of my hobby. The more I learn, more I understood that how little I know and that drives me to dig into technology and languages to explore.

From last few years now, working on Salesforce platform and providing customer solutions using as an Architect and Technical Lead Role. I have worked on many area of Salesforce like, Heroku, PHP Toolkit, Partner Webservices, Metadata and Enterprise webservices, Tooling API, Customer Portal, Partner Portal, Community, Salesforce1 etc...


Comments and Discussions

GeneralMy vote of 5 Pin
Member 17850917-Nov-12 0:48
Member 17850917-Nov-12 0:48 
QuestionNice Pin
Laserson31-Jul-12 23:47
Laserson31-Jul-12 23:47 
GeneralMy vote of 5 Pin
Eric.Ren Shiyi24-Mar-11 3:11
Eric.Ren Shiyi24-Mar-11 3:11 
Thanks, it is very helpful, I am try to setup an build server, but I still can not figure out.
GeneralLet CruiseControl.NET handle the source code Pin
Jens Buchta6-Apr-10 0:51
Jens Buchta6-Apr-10 0:51 
GeneralRe: Let CruiseControl.NET handle the source code Pin
Jitendra Zaa6-Apr-10 1:35
Jitendra Zaa6-Apr-10 1:35 
Questionyou do know that you username, password and web addresses are completely readable ? Pin
gpgemini3-Apr-10 19:43
gpgemini3-Apr-10 19:43 
AnswerRe: you do know that you username, password and web addresses are completely readable ? Pin
stano4-Apr-10 2:59
stano4-Apr-10 2:59 
AnswerRe: you do know that you username, password and web addresses are completely readable ? Pin
Jitendra Zaa4-Apr-10 21:00
Jitendra Zaa4-Apr-10 21:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.