Unable to cover unit tests that use Microsoft SQL Server

Symptoms

dotCover fails to perform coverage of unit tests with one of the following error messages:

  • Coverage session finished with errors: Can't set event mask (COM error 0x80131377).
  • Coverage session finished with errors: Can't profile the application because the host protection is applied. Probably it relates with Microsoft SQL…

 

Possible cause

  • As MS SQL prohibits access to its process, dotCover is unable to instrument it.

Solution

You should exclude sqlsrvr.exe from coverage using process filters. Currently, this is possible only for the console runner. To exclude sqlsrvr.exe, run coverage with the additional /ProcessFilters=sqlsrvr.exe argument.

2 out of 11 found this helpful
1 comment

Is there a fix in the works for the interactive test runner?

1

Please sign in to leave a comment.

Have more questions?

Submit a request