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

发布于 2024-07-21 07:00:17 字数 1838 浏览 7 评论 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:指定的文件没有有效的托管标头

有什么想法吗? 帮助!

I'm trying to apply a fix to allow NCover v1.5.5 to run on Windows Server 2008 X64 via my TeamCity Continuous Integration server as outlined on this blog:

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

Here is my log:

[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

So I'm trying to apply the CorFlags trick to make it work, but I am getting an error:

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 Conversion Tool. Version 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.

corflags : error CF008 : The specified file does not have a valid managed header

Any ideas?? Help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

司马昭之心 2024-07-28 07:00:18

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

    <exec program="tools\ncover\NCover.Console.exe" workingdir="${build.dir}\Debug\UnitTests">
        <arg value="//w "."" />
        <arg value="//x "..\..\test-reports\Coverage.xml"" />
        <arg value=""..\..\..\lib\NUnit-2.4.8-net-2.0\bin\nunit-console-x86.exe"" />
        <arg value=""UnitTests.dll" "/xml:..\..\test-reports\UnitTests.xml" "/nologo"" />
    </exec>

I actually solved this by upgrading to a newer version of NUnit, and changing my NCover task to point to the X86 version:

    <exec program="tools\ncover\NCover.Console.exe" workingdir="${build.dir}\Debug\UnitTests">
        <arg value="//w "."" />
        <arg value="//x "..\..\test-reports\Coverage.xml"" />
        <arg value=""..\..\..\lib\NUnit-2.4.8-net-2.0\bin\nunit-console-x86.exe"" />
        <arg value=""UnitTests.dll" "/xml:..\..\test-reports\UnitTests.xml" "/nologo"" />
    </exec>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文