Gallio (v3.0.6 and v3.1) with NCover v1.5.8 on x64
I spent the better part of a day trying to get Gallio’s runner to execute NCover and run our unit and integration tests as part of our build process. Our build server and all of our developer workstations run some variant of 64-bit Windows, e.g. Vista, 2008, 7, 2008 R2, etc.
At the command line, I would type the following:
Gallio.Echo.exe /runner:NCover PathToTestAssemblyMyApp.UnitTests.dll
Everything worked great except for NCover. NCover.Console.exe would stall and timeout after 60 seconds and then die saying “Profiled process terminated. Profiler connection not established.”
I tried things in a 32-bit virtual machine which worked great, so the problem had to be 64-bit related. I tried using the corflags 32bit flag trick, I tried explicitly specifying a 32-bit runner. I ran the build scripts as admin on my local machine. I even tried just running NCover.Console.exe directly specifying NUnit-Console-x86.exe but things still wouldn’t talk properly. What was going on?!
I stumbled upon an article that solved my problem. I simply ran: “regsvr32 coverlib.dll” from the command line in the NCoverv1.5.8 directory which registered a particular COM component. That took care of the problem. This old version of NCover wants to run with administrator privileges and requires registration of the COM component on the various machines that will run this coverage. That makes it difficult to ensure machine independence, but we’ll live with it for the time being.
UPDATE: You should be able to provide the following argument to Gallio.Echo to get the COM component to register during execution and unregister after execution:
Gallio.Echo.exe /runner:NCover /rp:"NCoverArguments='//reg' " ….
In the very near future we will be upgrading to NCover 3, but before we do, we want to ensure that we’re receiving value from NCover’s current reports before we invest money into it.the latest version.