Importing coverage from .coveragexml file

Hello @NDraskovic,

Welcome to the SonarSource community forum :wave:. We hope you’ll enjoy it.

No you don’t need VS Enterprise. This should work with any VS environment.

I can’t be certain, but I strongly suspect that the absolute source file paths in the coverage file do not correspond to the real path of the files on the file system of the 2nd machine. To confirm, please verify the paths in your TestCoverage.coveragexml file…

If that’s the confirmed root cause, the reason is I guess that you generated the coverage on the 1st machine, copied it on the 2nd and then tried to analyze with coverage on that 2nd machine. This is not the right way to do things (because of the potential path problem but also because you are never sure that the coverage file is aligned with the source files on the local machine).

The right way is to regenerate the coverage file every time your run the build and analysis script, and therefore you should modify your script to include a test coverage execution step after the MSBuild step.
See [Coverage & Test Data] Generate Reports for C#, VB.net for some help if needed

If you still run into trouble after this, please send me the logs of your script, preferable run in debug (add /d:sonar.verbose=true to your SonarScanner.MSBuild.exe executions)

Olivier