Your project contains C# files which cannot be analyzed with the scanner you are using. To analyze C# or VB.NET, you must use the SonarScanner for .NET 5.x or higher

Hi All,

I have setup SonarQube in Azure Devops via steps:

  - task: SonarQubePrepare@4
    condition: eq(variables['Build.SourceBranchName'], 'master')
    inputs:
      SonarQube: 'SonarQube-Services-Demo'
      scannerMode: 'CLI'
      configMode: 'manual'
      cliProjectKey: 'SNQ-DEMO-PRO'

 - task: SonarQubeAnalyze@4
    condition: eq(variables['Build.SourceBranchName'], 'master')
    displayName: "SonarQube Analyze Code"

  - task: SonarQubePublish@4
    condition: eq(variables['Build.SourceBranchName'], 'master')
    displayName: "SonarQube Publish Report"
    inputs:
     pollingTimeoutSec: '300'

The project being build and then scanned, is developed in .Net Core 3.1.

When the source is built and the scanned, but nothing is being done. There is the following in the logs:

“Your project contains C# files which cannot be analyzed with the scanner you are using. To analyze C# or VB.NET, you must use the SonarScanner for .NET 5.x or higher”

What do I need to do to get this to work / what am I doing wrong? I am using the latest version of SonarQube

Is there a way to do this in Azure?

Many Thanks.

Resolved by:

scannerMode: “MSBuild”

cliProjectKey being renamed to projectKey

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.