Skip to content

No code coverage generated from windows service - using Microsoft.CodeCoverage.Console #161

@Manishd79

Description

@Manishd79

Hello,

We have a windows service (exe) based upon many static libraries - native code. We are using Microsoft.CodeCoverage.Console to instrument statically the service exe. This instrumented service and other dlls are deployed on machine using our installer product. The service (instrumented) runs under "Local System" account and looks good.

We are relying on our E2E tests which perform many actions where service code (via static libs) definitely is touched, even we confirmed our product's events in the event viewer. However, the code coverage collection action is yielding no coverage for the service. I am putting a sample command as how I tried to run code coverage manually

Microsoft.CodeCoverage.Console collect --output C:\coveragefile.coverage --session-id --server-mode
Perform stop/start of service
Perform certain action for few static libs linked to service
Microsoft.CodeCoverage.Console collect shutdown

The same 'session guid' was used to instrument during compilation time.

The coveragefile.coverage does indicate our service as one of the instrumented exe but nothing reported covered:

Image

Appreciate some help/pointers as how to unblock here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions