views:

28

answers:

1

I have created a custom labeller for CC.Net which is working almost perfectly, however it appears that the labeller runs before the application is built. The issue I have with this is that I want my build label to be that of my AssemblyVersion.

I have the following in my labeller:

public string Generate(IIntegrationResult previousResult)
{

    if (File.Exists(this.OutputExecutable))
    {

        Assembly assembly = System.Reflection.Assembly.Load(System.IO.File.ReadAllBytes(this.OutputExecutable));
        string version = assembly.GetName().Version.ToString();
        assembly = null;

        return version;

    }
    else
    {
        return "0.0.0.0";
    }

}

This gets the version of the provided DLL/Exe so that I can use it as my build label. I'll probably go on to add the actual build number in later, but I just want to get this bit working first.

The issue is that my Revision number is in the format 2.0.93601.254 major.minor.date.svnrevision. When a check-in occurs, I build the codebase and the revision number would go to 2.0.93601.255. Unfortunately CC.Net still produces a Build Label of .254 until a force build is called when it will be successfully changed to .255.

Is there any way I can force the labeller to wait until the build process is complete? Or are there any alternative ways I should be doing this?

A: 

The answer to this I believe is no. What I did was to create my own console application that updates the assemblyinfo.cs file before the MSBuild task in CC.Net's project configuration. Problem (kind of) solved.

GenericTypeTea