Coverage Report Doesn't Match Open Cover when using .runsettings configuration

Hello @Sean_Comiskey

We have an open ticket for support runsettings.xml : #1487. To quote from there:

As a short-term answer, you will need to provide a new parameter (sonar.coverage.exclusion=LIST_OF_FILES) to the scanner for msbuild / .NET (or the prepare task of TFS/VSTS) OR configure your project on the SonarQube/SonarCloud project administration page to exclude all files you have excluded in your .runsettings file. Note that you can only exclude a file or a group of files BUT not something with a lower granularity.

Regarding file exclusions, you can read:

  1. Narrowing the Focus
  2. you can also exclude projects via the Scanner for MSBuild / .NET
  3. you can exclude specific classes with the ExcludeFromCodeCoverage attribute like explained here

Options 1 and 2 will exclude the files from analysis, in general, not only from the code coverage
computation.

Option 3 will exclude the classes only from code coverage.