NCoverLib registration

NCoverLib registration

Hello, I am using Web Services on .NET 2.0 and want to test how much of my code is covered.  I am using 1.5.2B3.
The process does not attach to my asp.NET working process however.
Trying to recover (pun intended ;-), I ran into a list of problems :-(

  1. In the FAQ I found a howto.  NCoverLib.dll is mentioned, and it should be registered.  I can find only a CoverLib.dll.
  2. When trying to register CoverLib.dll with regsvr32, I get the error "LoadLibrary (...) failed. The specified procedure could not be found."
  3. I downloaded the source, in the hope I could reproduce a working version.  In the file CoverageProfiler.h I find the following line "#include <boost/format.hpp>".  The build does not find this file.
Anybody who knows what to do ?  Thanks for your views.


Re: Profiler Connection Termination

The error message means that the .Net CLR profiler cannot find a registered profiler callback to invoke. You have to regsvr32 the coverlib.dll in the NCover folder which contains the implementation of the NCover code coverage profiler callback class.

TestDriven.Net gets around this using a local user registry trick (as do my NAnt/MSBuild tasks), then unregisters after running the coverage.


Re: NCover &amp; NUnit &amp; .Net 1.1 gives no coverage output

David,

Remove the ".dll" suffix from your list of assemblies in /a - in fact if you specify a working directory with /w you dont need any path in that argument

Also check to make sure you have COM registered CoverLib.dll in the NCover folder.

I have more things you can try if they don't work...

Regards,
Grant.


Re: NCover &amp; NUnit &amp; .Net 1.1 gives no coverage output

Hello Grant

Thanks for the response!  I have registered CoverLib.dll using resvr32 CoverLib.dll and it reported success.  I have also removed the .dll, and put in a working dir, but I get the same result.  The output in the coverage.log file is the same as I already posted.  If you could let me have your further suggestions that would be appreciated.

Thanks

David


Re: NCover &amp; NUnit &amp; .Net 1.1 gives no coverage output

Hi David,

I take it you get a coverage.xml file, but the nodes inside are empty? Heres a bunch more things to try:

1. Use the /w argument to specify a working directory, and change the /a so it only has the .dll name without the suffix, plus put all ncover arguments before the /c ones, plus all the NUnit arguments quoted together: - i.e.

ncover.console.exe
  /w "Z:\fo_core_systems\TSR\src\DummyDataCreatorTest\bin\Debug" 
  /a DummyDataCreator
  /c "C:\buildtools\NUnit\bin\nunit-console.exe"  
  "DummyDataCreatorTest.dll /noshadow"

2. Remove the /a argument. You only need it if you are trying to restrict which assemblies are included in the output. That should give you something?

3. Use an xml .settings file, with the /r argument.

4. Use my NCover NAnt or MSBuild tasks off my blog at http://www.kiwidude.com/blog/2006/07/nant-and-msbuild-tasks-for-ncover.html

5. Use TestDriven.Net right-click "Test with coverage" - great for interactive debugging in the IDE

I'm hoping Peter will update his FAQ otherwise I might chuck a blog/forum entry up sometime with some of the common symptoms/solutions for various NCover versions...

Let me know how you get on... if still having probs give us the full console output.
Grant.
http://www.kiwidude.com/blog/


Re: NCover &amp; NUnit &amp; .Net 1.1 gives no coverage output

Hello

Thanks for the tips, I have now got it to work for one of my test cases!!  However I have moved on to the next project that I need to build for my system and I am having another new and seemingly unrelated problem, described in this thread:

http://ncover.org/SITE/forums/405/ShowThread.aspx#405

Thanks again!  If you can help with the new problem as well that would be very much appreciated!

David