Search code examples
c#sonarqubesonar-runnersonarqube-msbuild-runner

SonarQube Scanner for MSBuild Architecture


Does anyone know if the SonarQube Scanner for MSBuild does a scan as part of the build and sends back only the results to SonarQube or is the EXE being instrumented at which point we could send the artifact to SonarQube on a Linux machine for analysis similar to how the java artifacts are scanned using sonar-scanner-cli?

https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+MSBuild


Solution

  • The analysis of C# and VB code is done as part of the MSBuild step, with the issues being written to a report. The report is processed during the Scanner End step, with the issues being posted to the SonarQube server. The Scanner for MSBuild does not instrument the binaries in any way.

    It doesn't make any difference to the Scanner for MSBuild if the SonarQube server is on a Linux machine or a Windows machine. Furthermore, it is now possible to run MSBuild and the Scanner for MSBuild on Linux machines (see the link to Scanning on Linux or macOS on the SonarQube docs page referred to in your question above).