Why is my task not working on CruiseControl (cannot find nunit)?

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

nant script (corresponding 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>

ss configuration:

<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 works, but I think the recent nunit update (to version 2.5.1) was confusing.

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

The beat is mystified! Can someone point me in the right direction?

+3
source share
2 answers

Well, have you installed NNnit 2.5.1.9189 on a continuous build machine in the GAC? (This is the exact version.)

GAC - , , YMMV.

+3

CruiseControl Windows , . - , GAC .

, Apache 2.2 (32-bit), CruiseControl 2.8 (32- Java, CruiseControl.NET) Windows Server 2008 R2 (x64). NAnt Devenv.com :

<exec program="Devenv.com" basedir="${compiler.basedir}">
  <arg line='/rebuild "Release" "${solution.file}"' />
</exec>

, , , , .

0
source

Source: https://habr.com/ru/post/1712670/


All Articles