Profiled process terminated message.

Profiled process terminated message.

I am using NCover 2.04 with TypeMock 4.10 on a 64-bit Win2k3 server. Our build is running the 32-bit environment in Powershell because parts of the build use MSBee to build against the 1.1 framework.

I can run the tests without any errors without NCover running. But when I run with code coverage turned on, I get the "Profile process terminated" message from NCover. The tests all still run with 0 errors, and it looks like the coverage XML files are written correctly. Any hints on how to clean up this error in the build?

-- Top-level exception (NCover.Framework.ProfilerRuntimeException)
Profiled process terminated. Profiler connection not established.
Make sure NCover is running with administrative privileges.
-- Stack Trace
   at NCover.Framework.ProfilerDriver.ExecuteProfiler()
   at NCover.Framework.ProfilerDriver.Run()
   at NCover.ConsoleMain.ConsoleMain.Main(String[] args)

MSBUILD : warning MSB3073: The command ""C:\Program Files (x86)\NCover\ncover.console" //x ..\Log\Tests\Cover-QueryProcessorTests.xml "C:\Program Files (x86)\NUnit\bin\nunit-console" /out=..\Log\Tests\Test-QueryProcessorTests.out /xml=..\Log\Tests\Test-QueryProcessorTests.xml ..\Output\Bin\QueryProcessorTests.dll" exited with code 20000.
The previous error was converted to a warning because the task was called with ContinueOnError=true.
Build continuing because "ContinueOnError" on the task "Exec" is set to "true".


RE: Profiled process terminated message.

Actually it looks like the coverage XML files are not created, so code coverage appears to not be working properly.


RE: Profiled process terminated message.

On 64-bit machines NCover installs for 64-bit by default. Use the //reg flag to run the 32-bit version of NCover on 64-bit machines.


RE: Profiled process terminated message.

Unfortunately if I add the //reg parameter to the Exec task it does not work correctly with the linked TypeMock profiler. Here is my exec task:

Failures: 1) TypeMock.TypeMockException : *** TypeMock.NET is not enabled

I'm not sure what the //reg switch exactly does.


RE: Profiled process terminated message.

I think I have this working now.

1) REGSVR32 NCover.Lib.x86.dll from the c:\Program Files (x86)\NCover folder to register the 32-bit version.

2) Next I ran CORFLAGS /32BIT+ NCover.Console.Exe from the c:\Program Files (x86)\NCover folder.

3) Reran the MSBuild unit test target in my project (without the //reg flag on NCover mentioned above BTW).

Completed with coverage!

I'm not sure if there is an enhancement request in there somewhere or not.


RE: Profiled process terminated message.

The //reg command does what "regsvr32 NCover.Lib.x86.dll" does, but only until NCover exits. Running regsvr32 removes the need to use the //reg flag. I've submitted a request to the Gnoso team to automatically register NCover for x86 applications on win64.

Stephen