Sonarqube allows for individual files to be excluded from code coverage by adding patterns in the sonar.coverage.exclusions key. This can be done on a project level by
Not enough rep to comment, but if you apply both answers here, you can simply add:
true
in the .csproj file to exclude the entire project instead of individual files, or relying on sonarqube filters.