Switching MSBUILD version from 4.0 to 14.0 provides different code coverage statistics calculated with dotCover
Hello,
Recently we've faced with situation when MSBUILD version was changed 4.0 - 14.0 and our code coverage statistics was dropped (dotCover, source code, etc. remained the same).
Before:
After:
After some investigations we figured out that source code was analyzed in different way (probably IL was changed and dotCover provided other results). It's not clear why we obtained new results since code was not changed.
We've created a sample project to let you reproduce it on your side. As for example of issues we noticed, please take a look at these ones:
Before (4.0):After (14.0):
Please clarify this behavior because it looks like a bug. Otherwise suggest your solution how to resolve this situation in order to provide the same statistics values that were before the change MSBUILD version to 14.0
Please sign in to leave a comment.
Source code (initial project + projects with tests) could be found by a link http://www.filedropper.com/coverageissuessolution
Hello Mikhail,
I'm sorry for the delayed reply.
IL code and PDB files generated by different MSBUILD versions could differ. dotCover gets information from PDB files about which ranges in source files match with which IL instructions. So, if PDB-s change, the highlighting changes too.
Regarding your example, there are 2 differences:
- auto-property is highlighted. Starting from dotCover 2016.2.1 a console runner option was implemented to exclude auto-properties from the report: /HideAutoProperties
You are welcome to try dotCover 2016.2.2 console runner: https://www.jetbrains.com/dotcover/download/#section=commandline
- catch() is highlighted differently, but we can't reproduce it on our side. And, actually, we can't do anything because of the reasons, which I've described above.