Ayende @ Rahien

My name is Oren Eini
Founder of Hibernating Rhinos LTD and RavenDB.
You can reach me by phone or email:


+972 52-548-6969

, @ Q c

Posts: 6,128 | Comments: 45,550

filter by tags archive

Coverage during acceptance tests?

time to read 1 min | 154 words

I am using WATIN for integration tests, and I really like it. The only problem that I have with it now is that I can't get tests run via WATIN to be covered using NCover. This is understandable, since the tests are excersizing a different appdomain (and process, they are run on IIS). This is really sad, since I now have a great deal of focus on the UI, and this means that I can't get the proper stats about it.

I can't think of any way to make NCover profile another process, but I do think that it is possible to profile another appdomain, which bring up the possibility of hosting ASP.Net myself and running the tests against that. (This is basically what MonoRail TestSupport does, but I never checked it coverage).

I'll give it a try tomorrow, any comments before I try this?


Jeroen van Menen


Following a section from the NCoverFAQ.html distributed with the 1.3 version. Haven't tried this myself but it might help you.

--> Start snippet

  1. How do I analyze an ASP.NET application with NCover?

xmspc got this to work on ASP.NET. See his post on the message board for more information. Here are the basics for getting it to work on Windows XP.

1) Ensure the NCoverLib COM component is registered (setup does this, but you can manually register it with regsvr32 if you wish).

2) Set the machine-wide COR profiling environment variables (or find some other way to get them set in the aspnet_wp.exe's environment):



3) Create %windir%\System32\Coverage.log and %windir%\System32\Coverage.xml and grant .\ASPNET read+write+modify permission to these 2 files only.

4) Force a restart of IIS so aspnet_wp.exe picks up the new environment variables. Coverage info will be written to the System32 directory.

All ASP.Net processes (on Windows XP for sure, don't know about Windows 2003) use %windir%\System32 as their working dir, therefore if multiple processes are running they will stomp over the Coverage files.

...would be nice if NCover used AppDomain basedir and/or value from app config file to set output file dir...

<-- End snippet

Kevin McDonnell

I've tried this before and ended up with all sorts of problems with PerfMon and IIS so be very careful with it!

Comment preview

Comments have been closed on this topic.


  1. The worker pattern - about one day from now

There are posts all the way to May 30, 2016


  1. The design of RavenDB 4.0 (14):
    26 May 2016 - The client side
  2. RavenDB 3.5 whirl wind tour (14):
    25 May 2016 - Got anything to declare, ya smuggler?
  3. Tasks for the new comer (2):
    15 Apr 2016 - Quartz.NET with RavenDB
  4. Code through the looking glass (5):
    18 Mar 2016 - And a linear search to rule them
  5. Find the bug (8):
    29 Feb 2016 - When you can't rely on your own identity
View all series


Main feed Feed Stats
Comments feed   Comments Feed Stats