Sonarqube is not analyzing c# files for .net4.7.2 frame work

Dear SonarQube Community,

We would like to bring to your attention an important matter regarding SonarQube’s current analysis capabilities. SonarScanner sonar-scanner-4.8.1.3023 is not analysing C# files for projects targeting .NET Framework 4.7.2 as expected.

This issue has been identified, and our development team is actively working on resolving it. We understand the importance of analyzing C# files for projects using .NET Framework 4.7.2, and we are committed to ensuring that SonarQube can provide accurate and comprehensive analysis for this framework

  1. You can see the logs below which we are getting in jenkins

INFO: 0/0 source files have been analyzed
INFO: Sensor IaC Docker Sensor [iac] (done) | time=108ms
INFO: ------------- Run sensors on project
INFO: Sensor C# [csharp]
WARN: No protobuf reports found. The C# files will not have highlighting and metrics. You can get help on the community forum: https://community.sonarsource.com
WARN: No Roslyn issue reports were found. The C# files have not been analyzed. You can get help on the community forum: https://community.sonarsource.com
INFO: Found 1 MSBuild C# project: 1 MAIN project.
INFO: Sensor C# [csharp] (done) | time=2ms
INFO: Sensor Analysis Warnings import [csharp]
INFO: Sensor Analysis Warnings import [csharp] (done) | time=1ms
INFO: Sensor C# File Caching Sensor [csharp]
WARN: Incremental PR analysis: Could not determine common base path, cache will not be computed. Consider setting ‘sonar.projectBaseDir’ property.
INFO: Sensor C# File Caching Sensor [csharp] (done) | time=1ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=305ms
INFO: SCM Publisher SCM provider for this project is: git
INFO: SCM Publisher 1546 source files to be analyzed

  1. Below is the Pipeline script
pipeline {
    agent any
    
    tools {
        jdk 'JDK11'
    }
    
    environment {
        NUGET_PATH = 'C:\\Nuget\\nuget.exe'
        MSBUILD_PATH = 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\MSBuild\\Current\\Bin\\MSBuild.exe'
        SONAR_SCANNER_HOME = 'C:\\ProgramData\\Jenkins\\.jenkins\\tools\\hudson.plugins.sonar.SonarRunnerInstallation\\Sonar'
        GIT_REPO_URL = 'http://****/scribing_software_1/scriberytev1'
        SOLUTION_PATH = 'C:\\ProgramData\\Jenkins\\.jenkins\\workspace\\DotNet_Pipeline\\ScribeRyteV1.sln'
        SONAR_PROJECT_KEY = 'DotNet'
        SONAR_HOST_URL = 'http://****'
    }

    stages {
        stage('Fetch Code') {
            steps {
                git(url: GIT_REPO_URL)
            }
        }

        stage('Build') {
            steps {
                bat "\"${NUGET_PATH}\" restore \"${SOLUTION_PATH}\""
            }
        }
        
        // stage('Unit Testing') {
        //     steps {
        //     }
        // }

        // stage('Integration Testing') {
        //     steps {
        //     }
        // }

        stage('SonarQube Analysis') {
            steps {
                script {
                    env.SONAR_RUNNER_HOME = env.SONAR_SCANNER_HOME
                }

                bat "\"${SONAR_SCANNER_HOME}\\bin\\sonar-scanner.bat\" -Dsonar.projectKey=${SONAR_PROJECT_KEY} -Dsonar.sources=. -Dsonar.language=cs -Dsonar.host.url=${SONAR_HOST_URL}"
            }
        }
    }
}


To analyze C# files you need to use the Scanner for NET – you can get an idea of what this looks like in a Jenkins context here