IIS and asp.net coverage

IIS and asp.net coverage

I'm having huge trouble getting NCover/Explorer to generate any sort of Coverage.xml file from my asp.net application.

I've tried it from the command line and from within NCoverExplorer itself. Most of the time I get an empty file. Occasionally, I get a coverage file of 5MB which just suddenly appears but seems to bear no resemblance to the activity I was performing in the website.
The coverage.log file shows that all the DLL's and PDB's I'm interested in are being successfully registered. To cap it all, the latest error I got was "Object reference not set to an instance of an object" which I've emailed to support. My app isn't big - there's only 30 aspx pages or so.

I love the idea of being able to show test coverage of an IIS app, but this is driving me mad. There's no indication of what is going wrong anywhere.


RE: IIS and asp.net coverage

We will follow up with the support ticket.

Are you running as an administrator?


RE: IIS and asp.net coverage

I am an admin and NCoverExplorer is running as an Admin, yes.

  1. Should the coverage.xml file be populated "as we go along", or is it only populated at the end (After ctrl-C is pressed)?

  2. Is there any way I can get info out of NCover to show it is catching requests and what it's doing as a result of catching them in realtime?

  3. I'm using WatiN to run my GUI tests, not Selenium, will that have any bearing? (Can't imagine it would, but thought I'd ask....)

  4. Will it catch ANY IIS requests for my app, or do they have to be attribute marked? Can't see how it would know the difference, but thought I'd ask....


RE: IIS and asp.net coverage

1) the coverage.xml should only be populated at the end 2) catching web requests? no. 3) not that we know of 4) NCover will catch the result (i.e. executed code) of any IIS request to your app


RE: IIS and asp.net coverage

sporewell said: 1) the coverage.xml should only be populated at the end

So how long does it take? Are there some "before" and "after" msgs in the log, or the output window I can see to indicate it's doing it / done it?


RE: IIS and asp.net coverage

how long it takes will depend on the size of the application. IIS/service won't end until you tell it it's done.

The closest you can get to a real time report of what NCover is doing is to tell NCover to create a verbose log file and then monitor the file for changes.

Stephen


RE: IIS and asp.net coverage

I've just tried it again with a completely clean application build and a reinstall of NCover 2.1. I turned verbose logging on and got a 56MB log file. I got a completely empty coverage file.
Should the "Working folder" I enter be the aspx directory, or the BIN directory? I've tried both without success. It asks for the assemblies folder (The bin directory), but your examples show the asp.net folder being selected, not the bin.

This is what I get in the output window within NCoverExplorer: -

NCover.Console v2.1.0 (Administrator x86) - Code Coverage Analysis for .NET Copyright (c) 2008 Gnoso Inc. http://www.ncover.com

Registered to Customer #: 16843 NCover Enterprise Edition (1 User) 25 days left in the trial period.

Command: Command Args: Working Directory: C:\Framework\WEB\CPCSNotifications\CPCSWAP Assemblies:

Program Output Stopping Service [World Wide Web Publishing]... Starting Service [World Wide Web Publishing]... The profiler will not connect until you load an ASP.NET page. Press Control-C to stop the service and collect coverage data.

Abort In Process Sending Control - C Received Control Event: Ctrl_C Stopping Service [World Wide Web Publishing] Stopping Process

Aborted by user.


RE: IIS and asp.net coverage

"Working folder" is irrelevant (not set) for IIS or service profiling.

have you examined the log file? are there any "unable to find symbols" messages? Are the dlls/exes you expect to get coverage on mentioned in the file?


RE: IIS and asp.net coverage

(Don't know how to add an image)

On the "Run NCover" GUI in NCoverExplorer, the first "Options" screen asks you to choose the type of app you're covering. When you choose the "IIS Webiste" radio button, you are prompted for: - "Working folder (i.e. your application assemblies folder)" You can't leave it blank, so what should go here? (See my previous msg for options I've tried)

Yes, there's lots of "Failed to load symbols for module xxxx" messages in the log, but they are all for framework classes and dll's - not mine. My DLLs appear to be loaded and monitored successfully: -

(0x000005BC) MESSAGE: ModuleLoadStarted ---- Module: 0x01587a20; 0x00000013 (0x000005BC) MESSAGE: Loaded symbols for module [C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\cpcswap\58507567\c4bbe339\assembly\dl3\30b26561\fec9be98_9b2ec901\PageManager.DLL] in [C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\cpcswap\58507567\c4bbe339\assembly\dl3\30b26561\fec9be98_9b2ec901]. (0x000005BC) MESSAGE: Attribute: [System.ComponentModel.EditorBrowsableAttribute] (0x000005BC) MESSAGE: Attribute: [System.CodeDom.Compiler.GeneratedCodeAttribute] (0x000005BC) MESSAGE: Class Load Start ---- Class[PageManager.My.MyComputer] (0x000005BC) MESSAGE: Attribute: [System.ComponentModel.EditorBrowsableAttribute] (0x000005BC) MESSAGE: Attribute: [System.CodeDom.Compiler.GeneratedCodeAttribute] (0x000005BC) MESSAGE: Method Load Start ---- Method[.ctor] (0x000005BC) MESSAGE: Attribute: [System.ComponentModel.EditorBrowsableAttribute] (0x000005BC) MESSAGE: Attribute: [System.Diagnostics.DebuggerHiddenAttribute] (0x000005BC) MESSAGE: Method Signature => .ctor() : void (0x000005BC) MESSAGE: IL Body at 0x0E002108 len(0x0000000B) (0x000005BC) MESSAGE: Sequence Points (0x000005BC) MESSAGE: Offset NextOffset Line Col EndLine EndCol Flags
(0x000005BC) MESSAGE: ============ ========== ========== ========== ========== ========== ========== (0x000005BC) MESSAGE: 0(0x0000) 0x0001 107 9 107 25 0x00010101 (0x000005BC) MESSAGE: 1(0x0001) 0x0008 108 13 108 25 0x00010000 (0x000005BC) MESSAGE: 8(0x0008) 0x0009 109 9 109 16 0x00010101 (0x000005BC) MESSAGE: 9(0x0009) 0x0000 0 0 0 0 0x00020000 (0x000005BC) MESSAGE: Method Load Complete ---- Method[.ctor]

Would the logfile help you? I have it available to send, if required.


RE: IIS and asp.net coverage

You can stick anything you want in the "working folder" directory, NCover will ignore it. That's it's available at all is an oversight that's been fixed in the next version

having the logfile would help. Could you email it to supportatgnosodotcom and reference this thread? thanks.