How to enable code coverage for COM+ server components

Hi,
I have a COM+ server component, a bunch of assemblies and corresponding unit tests for all of it. Code coverage works well except for the COM+ component where coverage is 0% although there are unit tests for it and they pass.
Is there a way to enable code coverage for a COM+ server component ? I know it works in library mode but I would like to stay as close to the target environment as possible.
Thanks in advance,
J.
[451 byte] By [Nidhogg] at [2007-12-16]
# 1

Code Coverage collection occurs for the session in which collection is started. If you have a COM+ server that runs as a service, then you cannot collect coverage data on it. We don't currently have support for collecting data on services.

If the server is launched and running as the user executing tests in that session, make sure that you've selected to instrument in-place to ensure we've instrumented the file that's actually executed. Also make sure to launch the server after you've started the unit tests.

Does this help you?

Chris
Microsoft Corporation

Chrismar at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...
# 2
The assembly seems to be instrumented because part of the code appears in the coverage report (static field initializers for example), but none of the code that is accessed through COM+.
It makes sense to run the server and the tests in the same session. In other words I need to use the interactive user for the COM+ server if I want code coverage. Having a specific user as identity for the server won't work, even if it's the same user as the user logged on because it's not the same session.
Unfortunately when I use the interactive user identity option, the server refuses to start and gives a 8000401a error (COM+ identity problem). It works if I set the identity manually but not when using the interactive user setting. I haven't found out why yet, I'll try looking into it some more.
Thanks for your help,
J.
Nidhogg at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...
# 3
This scenario may not be supported in the UI, so you may need to control collection from the command line. I got more information from the developer for you....

If the server is initializing in a different logon session than the monitor (vsperfmon.exe), then you'll need to be sure to launch the monitor with the /user option. If the server and monitor are in different TS sessions, then you’ll need to make sure you're running the monitor from the console.

The following article gives background on the monitor. Most of this applies to code coverage as well as the profiler.

http://blogs.msdn.com/angryrichard/articles/Profiling_Windows_Services.aspx

Chris

Chrismar at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...

Visual Studio Team System

Site Classified