为什么我的nant任务在CruiseControl上失败(找不到nunit)?

为什么我的nant任务在CruiseControl上失败(找不到nunit)?,nunit,cruisecontrol.net,nant,Nunit,Cruisecontrol.net,Nant,我的nant脚本在(Windows Server 2003)上的巡航控制下运行时失败,但在控制台上运行时工作正常 南音文字(相关章节): 运行nant的控制台命令: nant /f:WaterWorks.build build 有点迷惑了!有人能给我指出正确的方向吗?那么,您是否在GAC的连续构建机器上安装了NUnit版本2.5.1.9189?(正是这个版本。) 就个人而言,我不喜欢在GAC中安装依赖项-我喜欢用相对路径显式引用它们,但YMMV。将CruiseControl Windows服务

我的nant脚本在(Windows Server 2003)上的巡航控制下运行时失败,但在控制台上运行时工作正常

南音文字(相关章节):

运行nant的控制台命令:

nant /f:WaterWorks.build build

有点迷惑了!有人能给我指出正确的方向吗?

那么,您是否在GAC的连续构建机器上安装了NUnit版本2.5.1.9189?(正是这个版本。)


就个人而言,我不喜欢在GAC中安装依赖项-我喜欢用相对路径显式引用它们,但YMMV。

将CruiseControl Windows服务帐户从本地系统更改为管理员或其他更高级别的帐户,修复了我们遇到的类似问题。由于某些原因,我还没有弄清楚本地系统帐户无法正确访问GAC

正如您所知,我们在WindowsServer2008R2(x64)上使用的是Apache2.2(32位)、CruiseControl 2.8(32位Java版本,而不是CruiseControl.NET)。在NAnt中,我们使用Devenv.com构建解决方案:

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


我知道这是一个老生常谈的问题,但上面的问题可能会帮助其他人解决类似的问题。

对于单元测试库来说可能不那么重要,但对于其他依赖项,我肯定同意Jon的观点。谢谢Jon,但当nunit.framework.dll位于GAC中时,它仍然会出现同样的错误。我想我会选择你的明确参考解决方案,你确定这就是它在GAC中寻找的确切版本吗?我的意思是,使用显式引用仍然是一个好主意,但无论如何它都应该有效…nunit.framework 2.5.1.9189 96d09a1eb7f44a77 MSIL是的,这是正确的一个。。。。GAC不是我喜欢用的东西嗯。项目文件中的引用是什么样子的?
    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?) 
  :
  :
nant /f:WaterWorks.build build
<exec program="Devenv.com" basedir="${compiler.basedir}">
  <arg line='/rebuild "Release" "${solution.file}"' />
</exec>