You can see one of two possible 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…
The cause of the errors is host protection:
- dotCover gets the following result during profiler initialization when it asks CLR for the required callbacks: CORPROF_E_INCONSISTENT_FLAGS_WITH_HOST_PROTECTION_SETTING
Workarounds:
- Start local SQL database via the SQLLocalDB utility before you start your tests (http://msdn.microsoft.com/en-us/library/hh212961.aspx)
- Set your database to be trustworthy (for example, ALTER DATABASE [database_name] SET TRUSTWORTHY ON).

Comments