Latest Replies
Saturday
Jun072008

How to run free NCover on a 64 bit machine

There is a great code coverage tool called NCover that collects information about the code statements visited during the test execution. It has turned commercial but last free versions 1.5.8 are still available for download (BTW, you can use this service to skip the registration phase).

Additionally there is a great utility NCoverExplorer that excels at parsing and visualizing these code coverage reports. It also provides means to generate HTML reports and integrate them with CC.NET. It went commercial, too, but the last free version is still great.

NCoverExplorer with some LandorSystems code NCoverExplorer report

The only real benefit of the commercial (enterprise!) version for me was the ability to run NCover on 64 bit machine. Otherwise you would get the dreaded:

Profiled process terminated. Profiler connection not established.

Well, it turns out that you do not need to spend money on that. Here are the steps that worked for Windows Server 2008 64 bit (wasted 40mins on that):

  • Find corflags.exe from .NET 2.0 SDK or Microsoft SDK (on my machine it was in E:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin).
  • Execute it against NCover and your unit test runner (nunit-console.exe in my case) executables with /32BIT+ flag. I.e.:
    СorFlags.exe NCover.exe /32BIT+
    CorFlags.exe nunit-console.exe /32BIT+

This will actually force NCover and NUnit to run under WOW64 (x86 emulator that allows 32-bit Windows applications to run on 64-bit Windows).

Additionally, if you have the latest NUnit, you do not even have to modify its executable, just use nunit-console-x86.exe (this one has been compiled to run under 32 bits). Kudos to Cygon for brining this up!

PS: BTW, using Windows Server 2008 64 bit as the primary development environment turns out to be really enjoyable experience.

« Online Analytical Processing with .NET and DevExpress PivotGrid | Main | FxCop rules that Microsoft has turned on internally »

References (1)

References allow you to track sources for this article, as well as articles that were written in response to this article.
  • Response
    Response: Argghhh
    Hey. Let us so live that when we come to die even the undertaker will be sorry.I am from Gabon and also now am reading in English, please tell me right I wrote the following sentence: "We offer cheap airfare and airline deals for travel around the united states and the ...

Reader Comments (11)

[...] The implementation below is based on NCover, NUnit and CC.NET, but the concept itself does not care about specific [...]

What should be mentioned is that this will cause NUnit and NCover to run as 32 bit processes using the WoW6432 engine, so it's no longer 64 bit code that will be run.

NUnit 2.4.2 and later also provide nunit-console-x86.exe and nunit-x86.exe which have this flag already set, which means on a 64 bit system one can use nunit-console.exe to run the unit tests as true 64 bit code and nunit-console-x86.exe to run the unit tests in 32 bit emulation mode.

December 15, 2008 | Unregistered CommenterCygon

You rock! Awesome find, and I'm curious how you came about this solution?

December 19, 2008 | Unregistered CommenterJustin Etheredge

Cygon,

thank you for the information! I've updated the post

December 19, 2008 | Registered CommenterRinat Abdullin

Justin,

Google + dire need to get the thing working promptly under 64))

December 19, 2008 | Registered CommenterRinat Abdullin

just saved me from wasting extra 40 minutes!!! thanks

September 4, 2009 | Unregistered CommenterMax

What a waste of time. I wish i found this earlier. -_-

April 9, 2010 | Unregistered CommenterArnis L

Oh, THANK YOU, THANK YOU, THANK YOU, THANK YOU!

Where do I send the check :)

May 15, 2010 | Unregistered Commentercsharptest

Thank you so much, solved this problem beautifully :)

May 26, 2010 | Unregistered CommenterRicardo Diaz

Hey 2012 and still useful, in my case using NUnit 2.6, NCover Community Edition 1.5.8 and free NCoverExplorer 1.4 I just needed to use the nunit-console-x86.exe but it was because this advice that I notice that was the way. Thank you a lot

April 27, 2012 | Unregistered CommenterCamilo Martinez

Super useful post! Thanks a bunch, amazing that this is still so relevant. I am also using NUnit 2.6, NCover Community Edition 1.5.8 and free NCoverExplorer 1.4. I followed the instructions and converted the ncover executable to 32bit and then switched to using the x86 NUnit.

May 5, 2012 | Unregistered CommenterSteve

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>