How to run free NCover on a 64 bit machine
Saturday, June 7, 2008 at 5:52 Tweet 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.
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.
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.
You rock! Awesome find, and I'm curious how you came about this solution?
Cygon,
thank you for the information! I've updated the post
Justin,
Google + dire need to get the thing working promptly under 64))
just saved me from wasting extra 40 minutes!!! thanks
What a waste of time. I wish i found this earlier. -_-
Oh, THANK YOU, THANK YOU, THANK YOU, THANK YOU!
Where do I send the check :)
Thank you so much, solved this problem beautifully :)
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
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.