CruiseControl.NET and Subversion – SvnRevisionLabeller

5 03 2008

1. Download
2. Description
3. Usage
3.1. Build Labels
3.2. Installation
3.3. Configuration

1. Download

I recently contributed to a project that I find very useful:

SvnRevisionLabeller (direct download link) plugin for CruiseControl.NET by David Keaveny.
You can also find it having a look at the Contributions Page in the CruiseControl.Net official website (it’s the third item under the title: Labeller Blocks).

→ top of paragraph
→ top of post

2. Description

David Keaveny’s SvnRevisionLabeller lets CruiseControl.NET generate build labels based upon Subversion’s repository revision number.

I contributed to the project with a bug fix and by adding support for secure access to a Subversion repository (connecting with a repository’s particular account: username and password).

A file named Readme.txt comes zipped with the distribution.
Inside that file you can find instructions about how to install and configure SvnRevisionLabeller as the Labeller Block of choice in your CCnet configuration file.

In this article I will try to briefly guide you through these steps.

→ top of paragraph
→ top of post

3. Usage

Let’s have a look at how to setup CruiseControl.NET server to work with the SvnRevisionLabeller plugin.

3.1. Build Labels

SvnRevisionLabeller produces build labels in the format:

major and minor numbers are set in the configuration of the Labeller Block,
svnRevision number is retrieved from the Subversion repository,
build is automatically incremented if a new build is forced when no further modification to the repository happened.

The label produced by whichever Labeller Block is made available to the Task Blocks by means of the environment variable: CCNetLabel.
That environment variable can then be accessed by NAnt or MSBuild (as ${CCNetLabel} or $(CCNetLabel)) or by an External script with the usual syntax for environment variables on Windows Operating Systems: %CCNetLabel%.

3.2. Installation

Installing the SvnRevisionLabeller plugin is just a matter of unzipping the package ( into a temporary directory and of copying the assembly:

that you find inside the temporary directory into the directory in which CruiseControl.NET has been installed (e.g.: C:\Program Files\CruiseControl.NET\server).

Next you need to configure the Labeller Block in your projects in order to let them use SvnRevisionLabeller.
Let’s see how.

3.3. Configuration

Following is the basic configuration for SvnRevisionLabeller. Only the required fields are set:

<labeller type="svnRevisionLabeller">

where:<major> and <minor> are the first two numbers in the build label:
and <url> represents the path to the repository monitored by the current project. Actually the <url> field must be filled with the same path used in the <trunkurl> field of the Subversion Source Control Block:

<sourcecontrol type="svn">

Following is a configuration for the SvnRevisionLabeller with the complete set of fields:

<labeller type="svnRevisionLabeller">

where:<prefix> is a prefix added to the build label in the format:
<username> and <password> are the username and password of a valid Subversion account for the repository specified in the <url> field.
You’d better create a specific account used only by CruiseControl.NET.That’s it! In this way CruiseControl.NET will flag its builds with the revision number from Subversion and you can retrieve such value if you want to use it to modify the AssemblyInfo.cs files in your Visual Studio projects or if you want to flag your administrative backup names.

→ top of paragraph
→ top of post




8 responses

26 11 2008

Very useful info, but this tool only constructs the label, it does not put the label on the svn trunk if you not use the info in a nant script accessing svn?

15 01 2009

I’ve been trying out CCNetConfig, .
Thought I’d add a note about adding SvnRevisionLabeller to CCNetConfig.
For those that don’t know, CCNetConfig is a GUI app to setup the ccnet.config file.

Copy the file ccnet.SvnRevisionLabeller.plugin.dll to the directory where CCNetConfig is installed (C:\Program Files\CCNetConfig), and restart CCNetConfig.

That’s it, the labeller SvnRevisionLabeller should be available in CCNetConfig.

5 06 2009


Your article is great. I was following it step by step till I ran into the following issue.

I have CC.NET version : so I downloaded In the older version I believe the type is SvnRevisionLabeller with a capital “S” and I added that in the labeler block. I get the error saying that the type could not be found and the assembly could not be loaded. I have the assembly in C:\Program Files\CruiseControl.NET\server. It is still not able to get to the assembly. My main ccnet.config file is in a different folder and I have copied the assembly over even to that folder and still itsn’t working. I have checked the permissions and the cc account has access to the dll. Any idea what I could try next.

Your help is much appreciated.



5 06 2009


I followed RVW’s suggestion and downloaded CCNetConfig for X64 machine, dropped the above mentioned plugin in the C:\Program Files\CCNetConfig and it worked like a charm.

Thanks for all the helpful tips and tricks. Now that the builds are the same as SVN’s revision no, I’ll try my hands at making the dll versions the same too.

Thanks again

27 05 2011
Sujoy Upadhyay

I added the following in my segment


But this does not work . Error text is

Unable to load array item labeller…

26 10 2012

Hi there!
I cannot getting BUILD label increasing when i click on Force build!?
When i put {rebuild} instead of {build} that number is increasing but doesn’t reset after svn revision is changed!? Any ideas?

C:\Program Files\SlikSvn\bin\svn.exe

26 10 2012

hmm it does’t allow to insert XML tags ?

29 09 2018
CruiseControl.Net Tutorial – Part 1 – The working dad

[…] When I first wrote this post there was no assemblyVersionLabeller available in and I found a plugin, named SvnRevisionLabeller by David Keaveny (to which I contributed). This plugin allows labelling CruiseControl.NET builds with Subversion’s repository revision numbers and I think this is a really useful feature. It can be still useful but not needed so I won’t use it in this post. For detailed information about this plugin see my post: CruiseControl.NET and Subversion – SvnRevisionLabeller. […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: