Why does my nant fail on CruiseControl (can not find nunit)?

advertisements

My nant script fails when I run it under cruise-control on (Windows Server 2003), but works fine when run on the console.

nant script (relevant section):

<target name="compile" depends="init">
    <echo message="Build Directory is ${build.dir}" />
    <exec program="${framework::get-framework-directory(framework::get-target-framework())}\msbuild.exe"
          commandline="${solution.file} /m /t:Clean /p:Configuration=${project.config} /v:q" workingdir="." />
    <exec program="${framework::get-framework-directory(framework::get-target-framework())}\msbuild.exe"
          commandline="${solution.file} /m /t:Rebuild /p:Configuration=${project.config} /v:q" workingdir="." />
</target>

cc-config:

<tasks>

    <nant>
        <executable>C:\Program Files\nant-0.86-beta1\bin\nant.exe</executable>
        <baseDirectory>C:\Builds\WorkManagement\RC1</baseDirectory>
        <buildArgs>-D:outputType=Xml</buildArgs>
        <nologo>false</nologo>
        <buildFile>WaterWorks.build</buildFile>
        <targetList>
            <target>build</target>
        </targetList>
        <buildTimeoutSeconds>1200</buildTimeoutSeconds>
    </nant>

</tasks>

This has been working but I think a recent upgrade of nunit (to 2.5.1) has confused things.

cc nant log:

    Buildfile: file:///C:/Builds/WorkManagement/RC1/WaterWorks.build
    Target framework: Microsoft .NET Framework 3.5
    Target(s) specified: build
    [loadtasks] Scanning assembly "NCoverExplorer.NAntTasks" for extensions.
    [property] Read-only property "outputType" cannot be overwritten. 

    clean: 

    [delete] Deleting directory 'C:\Builds\WorkManagement\RC1\build'. 

    version: 

    init: 

    [tstamp] 15 July 2009 10:31:20.
    [mkdir] Creating directory 'C:\Builds\WorkManagement\RC1\build\net-3.5.win32-WaterWorksConsole-release\'.
    [echo] Current Directory: C:\Builds\WorkManagement\RC1 

    drop-database: 

    create-database: 

    compile: 

    [echo] Build Directory is build/net-3.5.win32-WaterWorksConsole-release/
    [exec] Microsoft (R) Build Engine Version 3.5.21022.8
    [exec] [Microsoft .NET Framework, Version 2.0.50727.1433]
    [exec] Copyright (C) Microsoft Corporation 2007. All rights reserved.
    [exec] Microsoft (R) Build Engine Version 3.5.21022.8
    [exec] [Microsoft .NET Framework, Version 2.0.50727.1433]
    [exec] Copyright (C) Microsoft Corporation 2007. All rights reserved.
    [exec] C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets : warning MSB3245: Could not resolve this reference. Could not locate the assembly "nunit.framework, Version=2.5.1.9189, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
    [exec] AddressTests.cs(1,7): error CS0246: The type or namespace name 'NUnit' could not be found (are you missing a using directive or an assembly reference?)
  :
  :

console command to run nant:

nant /f:WaterWorks.build build

Bit mystified! Can anyone point me in the right direction?


Well, have you installed NUnit version 2.5.1.9189 on the continuous build machine in the GAC? (That exact version.)

Personally I don't like installing dependencies in the GAC anyway - I like to have them explicitly referenced with relative paths, but YMMV.