NCover throwing exception - No data was collected.

NCover throwing exception - No data was collected.

While running NCOver.Console, i am getting following error:

Top-level exception (system.exception) No data was collected. --Stack Trace at NCover.Framework.ProfilerDriver._GetCoverageData() at NCover.Framework.ProfilerDriver.Execute() at NCover.ConsoleMain.ConsoleMain.Main(String[] args)

i have the pdb files in the local app directory.

Your help is appreciated.


RE: NCover throwing exception - No data was collected.

are you running on a 64-bit machine? What type of application are you covering (IIS, Windows service, standard app)? what command line arguments did you use?

Stephen


RE: NCover throwing exception - No data was collected.

Yes i am running a .net std application on 64 bit machine. I tried using the following cmd:

Set Path=C:\Program Files\NCover; %PATH% NCover.Console //wal 5 "C:\Program Files\DEV\Startup.exe"

But it gives me the error.

Thanks


RE: NCover throwing exception - No data was collected.

is the program you're trying to profile a 32 or a 64-bit application?


RE: NCover throwing exception - No data was collected.

its a 32 bit app.


RE: NCover throwing exception - No data was collected.

which version of NCover are you using?


RE: NCover throwing exception - No data was collected.

also, you should use the NCover in "C:\program file (x86)\NCover"


RE: NCover throwing exception - No data was collected.

I am getting same error when running on 32 bit application. Using Ncover 2.1 on .net 2.0 application. I have included the dll and pdb in the local directory.


RE: NCover throwing exception - No data was collected.

Also where should be the dlls' and pdb files located? I have placed in each folder nodes like Syncfusion.Charting, Syncfusion.Common methods.


RE: NCover throwing exception - No data was collected.

pdbs should be located next to wherever the dlls are loading form, which is typically a bin\debug or bin\release folder

if you are running on a 64-bit machine, you should used the NCover.Console in "C:\program files (x86)\ncover\" and add the //reg flag to the command line


RE: NCover throwing exception - No data was collected.

this issue occurs on both 64 bit and 32 bit machine. Currently i see the same error on 32 bit machine. What am i missing here? Do i have to include the assembly dlls in command prompt?


RE: NCover throwing exception - No data was collected.

no, adding the assemblies to the command prompt won't help. the error happens because the NCover coverage dll is never loaded into whatever process you are trying to cover.

suggestions: 1) make sure the NCover.lib.x86 dll is registered by using 'regsvr32 NCover.Lib.x86.dll' from within the C:\program files\NCover directory. 2) run NCover with the //reg flag to foce NCover to register the dll for the running user

are you trying to cover a windows app, or a service/ASP.NET application?


RE: NCover throwing exception - No data was collected.

i'm getting the same exception - in about every second build! i then make a "force build" upon which the error magically disappears, everything builds fine, i get the coverage information... until next build.

what i need to add is that im using a win2008 x64 server with ncover x64 and typemock 5.1 x64. it was a real challenge to get this working - and now it is, but only every second time... what could cause this behaviour?


RE: NCover throwing exception - No data was collected.

the ncover client dll isn't getting loaded into the process that you want coverage on. Have you tried forcing it w/ the //reg flag, and perhaps running "regsvr32 NCover.lib.x64.dll"?

are you covering a stand-alone app or a service/IIS?


RE: NCover throwing exception - No data was collected.

it was quite a mess getting ncover and typemock to work together (and obviously it's still not perfect). i have described my setup here: http://www.typemock.com/community/viewtopic.php?t=988

so the answer is yes and yes - in fact i have permanently registered ncover.lib.x64.dll on the machine - otherwise i couldn't make it work at all.


RE: NCover throwing exception - No data was collected.

and... no, i'm testing a very simple solution with about 3 class libraries.


RE: NCover throwing exception - No data was collected.

if you leave the typemock config alone, but run your tests just with NCover, can you consistently get coverage back? Typemock and NCover use the same APIs to interact w/ the CLR, so there might be interference between them.


RE: NCover throwing exception - No data was collected.

Yes, it seems that running running either TypeMock (with TMRunner) OR NCover works fine - but running them together doesn't. I can't tell exactly when it doesn't work: it seems to work after a certain break (the next day) and it does work the next time after a failure (when forcing a rebuild); sometimes it even works twice or three times in a row. The failure is always the same:

The command [...] exited with code 20000: Exception -- Top-level exception (System.Exception) No data was collected. -- Stack Trace at NCover.Framework.ProfilerDriver._GetCoverageData() at NCover.Framework.ProfilerDriver.Execute() at NCover.ConsoleMain.ConsoleMain.Main(String[] args)

Any more ideas on this one?


RE: NCover throwing exception - No data was collected.

srudin,

just a quick update; I've been working on this problem (off and on) since I last responded, but I've had only minor success duplicating the problem. I'm running typemock isolator 5.1 on the "Example" C# project that comes with the application, and running the Nunit tests under NCover. I had a little trouble getting everything set up, but right now I am successfully and consistently running typemock and NCover together on the NUnit tests. I've tried forcing and not-forcing a Rebuild of the solution, but the tests still run successfully. I've modified the source and done a partial, not a complete, rebuild, and the tests still run successfully. I've run the test task 12 times in a row and gotten success each time.

now, when I run with mstest I always get a failure. so, are you running mstest or Nunit? and this blog post may help you out: http://www.cauldwell.net/patrick/blog/TypeMockMSBuildAndNCover.aspx

Stephen


RE: NCover throwing exception - No data was collected.

Thanks for taking care of this. We are only using NUnit - and I had the error twice in a row only 5min. ago. After forcing the build twice, it worked. It is quite difficult for me to provide you with further information. My test solution only has a simple class library and a tester, both with no special references. I built a custom FilterContext and a test mocking the WriteData method of the TraceSource (mabe there is a problem when mocking instances from System.Diagnostics?). Besides that the only speciality (as far as I would say) is that it's a x64 server and some tools are available as x64 editions (NCover, TypeMock) and others not (NUnit, MsBuild).

Let me add that honestly I think the problem is TypeMock and not NCover. I think the problem lies within the integration and how and when the tools need to be started, registered etc. For example I still do not know exactly how to link these tools - I am currently doing it manually with the TypeMockConfigurator UI. I believe that is a problem but couldn't get automatic registering to work. Perhaps you could give an detailed step-by-step instruction how to best setup these two tools?


RE: NCover throwing exception - No data was collected.

srudin,

Is it possible for you to send us your project or a minimal project that recreates the problem you're having? If so, send an email to supportatgnosodotcom and reference this forum post.

I've started a how-to on using typemock with NCover, but it's bare at the moment because the concept and execution are simple; it's the problems/FAQ that will make it interesting and helpful so I'm trying to collect problem cases, solve them, and add the solutions as an FAQ before the article is published.

MSTest and NUnit are CLR apps so they should run as 64-bit processes on a 64-bit machine unless someone's run corflags /32BIT+ on them.

I've gotten NCover and typemock working with and w/o the build-script registration. Have you used Link="NCover2.0"? I also found out that you can't use NCover //reg argument or things get messed up.

Stephen


RE: NCover throwing exception - No data was collected.

You can find the information regarding my configuration here: http://www.typemock.com/community/viewtopic.php?t=988

As you can see there I couldn't get it to work when using the Link="NCover2.0" option.

The project causing the problem is testing a custom log class that is using a TraceSource instance. We are mocking our custom TraceListener to make sure it gets called correctly via the TraceSource, but when testing we don't really want to write the message to a log - hence the mocking. I imagine our problems might be related to the fact that we are mocking a System.Diagnostics class?

It this does not help I can offer you a remote connection to our build server using TeamViewer. Would this be an option?


RE: NCover throwing exception - No data was collected.

System.Diagnostics might be part of the problem, I don't know yet. I'll take the information you've just given me and try to recreate the problem, and if it fails I'll need to talk to the team to figure out how best to proceed -- we'll keep the remote connection in mind. You should hear back by end of day Wednesday.

Stephen


RE: NCover throwing exception - No data was collected.

It's friday now and I haven't got any answer. We are getting the "NCover exited with Code 2: No data collected" error in about three completely independent builds now. They are showing up infrequently and forcing a rebuild several times makes them disappear for one clean build - then they show up again. This is getting serious as it is impossible to work like that. I need to turn off NCover and request a refund if we can not get this to work soon.


RE: NCover throwing exception - No data was collected.

Apologies for not responding when I said I would. The truth is that I was sidetracked by other cases and completely forgot about this one until I checked the forums again. However, I have worked on the issue more, but still haven't been able to replicate on my Vista OS, so I need to set up and test on Server 08 x64.


RE: NCover throwing exception - No data was collected.

I've tested on server 08 and still haven't been able to reproduce the problem. Is there any way you can send us a small sample project that runs into the program so we know that we're starting with a project that doesn't work?

NB: During testing, my Typemock install got messed up and it started not working. But I fixed it by reinstalling Typemock. Have you tried uninstalling and reinstalling Typemock?


RE: NCover throwing exception - No data was collected.

i have reinstalled typemock and it seems that the problem now is a constant issue; i could not get a build to work so far and i have forced about five times now (usually it took 2-3 times, then it worked). i don't know whether this is good or bad though... ;-)

here's the output:

Program Output NUnit version 2.4.8 Copyright (C) 2002-2007 Charlie Poole. Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov. Copyright (C) 2000-2002 Philip Craig. All Rights Reserved. Runtime Environment - OS Version: Microsoft Windows NT 6.0.6001 Service Pack 1 CLR Version: 2.0.50727.3053 ( Net 2.0.50727.3053 ) . Tests run: 1, Failures: 0, Not run: 0, Time: 1.437 seconds Exception -- Top-level exception (System.Exception) No data was collected. -- Stack Trace at NCover.Framework.ProfilerDriver._GetCoverageData() at NCover.Framework.ProfilerDriver.Execute() at NCover.ConsoleMain.ConsoleMain.Main(String[] args) The command ""C:\Program Files\NCover\ncover.console.exe" //a "Garaio.Products.CustomTools\bin\Release\Garaio.Products.CustomTools.dll;Garaio.Products.CustomTools.Tester\bin\Release\Garaio.Products.CustomTools.Tester.dll" //x "..\Output\NCover-RawData.xml" //ea "System.Diagnostics.DebuggerNonUserCodeAttribute" "C:\Program Files (x86)\NUnit 2.4.8\bin\nunit-console.exe" /noshadow "Garaio.Products.CustomTools.Tester\bin\Release\Garaio.Products.CustomTools.Tester.dll" "/xml=..\Output\NUnit-GaraioResults.xml"" exited with code 20000.


RE: NCover throwing exception - No data was collected.

I have uninstalled both TypeMock and NCover and reinstalled first NCover 2.1.0 X64 (selecting only the X64 option in the setup), then TypeMock 5.1 (deselecting all options). I have now forced several builds without experiencing the problem.

I can only think of a dll registration problem, so this error might get solved reinstalling the two products. It might also be better to only install the X64 version of NCover as there might be a problem when both are registered. Or maybe it has something to do with the order of installation?

I really don't know and don't intend to find out as I will not change the system as long as it runs... So I'm enjoying a stable build server now! I will tell you in case the problem shows up again...

Thank you for your support and patience and hopefully you don't hear anything more from me!

Best regards


RE: NCover throwing exception - No data was collected.

I'm glad the issue seems to have been resolved. We are working with the Typemock team to ensure better integration of NCover and Typemock.

Stephen


RE: NCover throwing exception - No data was collected.

Guess what... yes, the error started to pop up again. I think it never really disappeared, it just worked more often than before, but since the last two or three days we're back to the old rythm. What now?


RE: NCover throwing exception - No data was collected.

srudin,

I just saw this post. Would you mind opening a support case (email support at gnoso dot com) so we can provide a faster response? Reference this thread when you open the support case.

Stephen


RE: NCover throwing exception - No data was collected.

I am very happy to say that the problem has most likely been found and the error fixed!

I did a remote session today with the TypeMock guys and they figured out that I was starting "nunit-console.exe". Now in one of the newer NUnit versions they changed the old "nunit-console.exe" to "nunit-console-x86.exe" and made a new "ncover-console.exe" which is now x64 (!). That then gave problems when running NCover and TypeMock.

After running "nunit-console-x86.exe" with the x86 version of NCover seems to have fixed all the problems. Thanks again to the people from TypeMock!


RE: NCover throwing exception - No data was collected.

srudin,

thank you very much for the update!