x86, DLL registered, no data was collected

x86, DLL registered, no data was collected

Below is the output I get from running NCover on a x86 Windows XP SP3 VMWare Virtual Machine.

The DLL is registered (plus, //reg option is used). The user is admin.

When I first tried with NCover v2.0.3, I got a different error: "Profiled process terminated. Profiler connection not established." I was hoping upgrade to v3.x would fix it, but apparently not. I suspect both errors might share the same root cause.

Here is the command that was run (NCover 3.2.2):

"C:\Program Files\NCover\ncover.console.exe" //at "C:\Dev\Junk2\EchoService\EchoService\trending.trend" //x "C:\Dev\Junk2\EchoService\EchoService\coverage.xml" //l "C:\Dev\Junk2\EchoService\EchoService\coverage.log" //ll "Verbose" //svc "EchoService" //p "New Project" //reg //ssp "Registry, SymbolServer, BuildPath, ExecutingDir"

And, here's the output:

NCover Complete Trial v3.2.2 x86 (Administrator) Copyright (c) 2007 - 2009 Gnoso Inc. License Key: *********************** Registered to Customer #: xxxxx for 1 Machine 22 days left in the trial period.

Command: Command Args: Working Directory: Assemblies: (All Loaded Assemblies)

Program Output Starting Service [EchoService]... Press Control-C to stop the service and collect coverage data.

Received Control Event: Ctrl_C Stopping Service [EchoService]

----*----------------------------------------------------------------------- ---- Top level exception: System.Exception No data was collected. at NCover.Framework.ProfilerDriver._GetCoverageData() at NCover.Framework.ProfilerDriver.ExecuteNCover(Int32& profiledAppCode) at NCover.Framework.ProfilerDriver.Execute(Int32& profiledAppCode)

at NCover.ConsoleMain.ConsoleMain.RunCoverage(String[] args, IOutputWriter output)

Exception ***************

NCover.Console is returning exit code #20000


RE: x86, DLL registered, no data was collected

Is EchoService the friendly name or the service name? You may need to go to your services and right click and under properties there should be the service name.

Tell me if that helps.


RE: x86, DLL registered, no data was collected

EchoService is the service name. NCover.console seems to start/stop the service just fine. So I know it's finding the service.


RE: x86, DLL registered, no data was collected

is a log file created? what are its contents? I believe you've done this already, but you should try running "regsvr32 ncover.lib.x86.dll" from the directory that NCover is installed in


RE: x86, DLL registered, no data was collected

Yes, regsvr32 ncover.lib.x86.dll was executed successfully before running the command.

Coverage.log is created but has no content in it.

Is there a log file that Ncover creates that includes info not necessarily about the coverage, but about what it is doing, such as, where it is trying to find the profiler, what classes it is loading, where it is crashing, etc.?

Also when the same piece of code was profiled on a different XP machine (not a VM), it worked fine. I don't know if it would be a VM issue?


RE: x86, DLL registered, no data was collected

what language is the service written in?


RE: x86, DLL registered, no data was collected

C#. It's your sample service app that I downloaded from ncover.com.


RE: x86, DLL registered, no data was collected

what sample service app?


RE: x86, DLL registered, no data was collected

http://docs.ncover.com/how-to/code-coverage-of-windows-services/

http://s3.amazonaws.com/ncover_docs_assets/original/59/EchoService.zip


RE: x86, DLL registered, no data was collected

hmm. I'll be handling this exclusively through the support system.


RE: x86, DLL registered, no data was collected

For anyone else that runs into this issue.

If you are not able to collect coverage from a windows service and it is running under the local system account, change the account to be a local or domain admin account.

A sign that you are having this issue is there will be an error in the event log CoCreateProfiler Failed.

Once you change to a local admin account, your problem should be resolved.

Joe Feser


RE: x86, DLL registered, no data was collected

Thank you for the advice... I was experienceing the same issue and was able to resolve it through the infomation you supplied... I wasn't seeing the CoCreateProfiler error, but changing the account the service start under from Local System (with interact with desktop) to the currentl oogged-on user got things going... thanks again, Paul


RE: x86, DLL registered, no data was collected

Thank you for the advice... I was experienceing the same issue and was able to resolve it through the infomation you supplied... I wasn't seeing the CoCreateProfiler error, but changing the account the service start under from Local System (with interact with desktop) to the current logged-on user got things going... thanks again, Paul


RE: x86, DLL registered, no data was collected

That's excellent news -- thanks for posting, Paul.

NCover Support