I'm trying to use OpenCover to get coverage metrics for a service using Topshelf. The application runs fine from the console.
When the application runs it prints the following:
The service is now running, press Control+C to exit.
Then once Control+C is pressed it prints
Control+C detected, attempting to stop service.
When done without OpenCover the application catches the Ctrl+C and stops normally, returning the command prompt when it's finished.
I'm running the application through OpenCover with the command:
OpenCover.Console.exe -target:service.exe -log:All -register:administrator
When done through OpenCover I think OpenCover catches the Ctrl+C immediately and then passes it to my service application. The result is that OpenCover dies immediately but the target application for coverage is still running and takes a few extra seconds to stop. I can see the service process still going in Process Explorer and it prints its cleanup messages to stdout as it dies.
If the application that OpenCover is trying to get metrics from shuts down after OpenCover has stopped can OpenCover still get coverage information?