64位上的NCover - CorFlags修复 - corflags:错误CF008:指定的文件没有有效的托管头

时间:2009-05-20 14:10:37

标签: teamcity code-coverage ncover corflags

我正在尝试应用修复程序,允许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:指定的文件没有有效的托管标题

任何想法?救命啊!

1 个答案:

答案 0 :(得分: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>