0

我正在尝试应用修复程序以允许 NCover v1.5.5 通过我的 TeamCity 持续集成服务器在 Windows Server 2008 X64 上运行,如本博客所述:

http://abdullin.com/journal/2008/6/6/how-to-run-free-ncover-on-a-64-bit-machine.html

这是我的日志:

[09:47:04]: run-unit-tests:
[09:47:04]: [echo] Running NCover: tools\ncover\NCover.Console.exe with workingdir='build\Debug\UnitTests'
[09:47:04]: [exec] NCover.Console v1.5.5 - Code Coverage Analysis for .NET - http://ncover.org
[09:47:04]: [exec] Copyright (c) 2004-2005 Peter Waldschmidt
[09:47:04]: [exec]
[09:47:04]: [exec]
[09:47:04]: [exec] Command: ..\..\..\tools\nunit\nunit-console.exe
[09:47:04]: [exec] Command Args: "UnitTests.dll" "/xml:..\..\test-reports\UnitTests.xml" "/nologo"
[09:47:04]: [exec] Working Directory: .
[09:47:04]: [exec] Assemblies:
[09:47:04]: [exec] Coverage Xml: D:\TeamCity\buildAgent\work\a65ff8d0771db303\build\test-reports\Coverage.xml
[09:47:04]: [exec] Coverage Log: Coverage.Log
[09:47:04]: [exec]
[09:47:07]: [exec] Waiting for profiled application to connect.......N.N.N.N..N.......
[09:47:07]: [exec] Tests run: 11, Failures: 0, Not run: 5, Time: 1.096 seconds
[09:47:07]: [exec]

[09:47:07]: [exec]
[09:48:04]: [exec] Connected
[09:48:04]: [exec] **Profiled process terminated. Profiler connection not established.**
[09:48:04]: BUILD FAILED

所以我试图应用 CorFlags 技巧使其工作,但我收到一个错误:

C:\Program Files (x86)\Microsoft.NET\SDK\v2.0\Bin>CorFlags.exe D:\TeamCity\build Agent\work\a65ff8d0771db303\tools\NCover\NCover.exe /32BIT+

Microsoft (R) .NET Framework CorFlags 转换工具。版本 2.0.50727.42 版权所有 (c) Microsoft Corporation。版权所有。

corflags:错误 CF008:指定的文件没有有效的托管标头

有任何想法吗??帮助!

4

1 回答 1

2

实际上,我通过升级到更新版本的 NUnit 并将我的 NCover 任务更改为指向 X86 版本来解决这个问题:

    <exec program="tools\ncover\NCover.Console.exe" workingdir="${build.dir}\Debug\UnitTests">
        <arg value="//w &quot;.&quot;" />
        <arg value="//x &quot;..\..\test-reports\Coverage.xml&quot;" />
        <arg value="&quot;..\..\..\lib\NUnit-2.4.8-net-2.0\bin\nunit-console-x86.exe&quot;" />
        <arg value="&quot;UnitTests.dll&quot; &quot;/xml:..\..\test-reports\UnitTests.xml&quot; &quot;/nologo&quot;" />
    </exec>
于 2009-05-20T15:41:17.237 回答