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.

Please sign in to leave a comment.

Have more questions?

Submit a request