Covering an EXE server spawned by COM SCM

Covering an EXE server spawned by COM SCM

Hi

My team run ccnet under a domain service account (cannot be used to log in interactively) on a Windows Server 2008 R2 machine.

Among our MSTests, we have one that uses Excel 2007 as a COM component (via PIAs). When it runs, Excel.exe gets spawned as a child process of the COM(+) Service Control Manager.

Is there a way to tell NCover to attach it?

On developer machines Excel gets spawned by the COM runtime as a child process of MSTest so //pn EXCEL works fine.

Thanks!


RE: Covering an EXE server spawned by COM SCM

masariello,

Sorry it has taken some time to reply. We've been considering this case carefully. Here's one possibility for you. It should work.

From the command line, type: start NCover.Console.exe //svc DcomLaunch //x [coverage file] //pn Excel

From the new prompt, type: NCover.Console.exe //x [coverage file] [test command line]

When finished, you will want to do a restart of your COM service. Type the following commands into your prompt:

net stop DcomLaunch

net start DcomLaunch

Note that this solution should work in a script as well. We look forward to hearing back from you when you've had a chance to implement. Please send us a note at support@ncover.com to let us know. Thanks for using NCover!


RE: Covering an EXE server spawned by COM SCM

Thanks D! :-)

I see what you are saying. It's a bit radical, but it does look like it should work

Hopefully restarting the DCOM launcher will not have major consequences for running DCOM servers...something to watch out for, I guess


RE: Covering an EXE server spawned by COM SCM

As I feared, DcomLaunch is a very special service as it cannot be stopped (to be restarted with a profiler). I have strong doubts that //svc DcomLaunch will work.

C:>net stop DcomLaunch
The requested pause, continue, or stop is not valid for this service.
More help is available by typing NET HELPMSG 2191.

C:>sc stop DcomLaunch
[SC] ControlService FAILED 1052:
The requested control is not valid for this service.