Main branch has no lines of code - C# AzureDevops .NET 5

Hi @Juan_Carrey1. Full disclaimer, I am currently working to set up SonarQube and then integrate it with Azure DevOps, but have not done so yet, so I do not have the experience of getting this flow working.

When I set up an empty YAML Pipeline in Azure DevOps and search for the SonarQube Prepare task, these are the options I am presented with:

This configuration results in:

- task: SonarQubePrepare@4
  inputs:
    SonarQube: 'SonarQube Coverage Test'
    scannerMode: 'MSBuild'
    projectKey: 'MyProjectKey'
    projectName: 'MyProjectName'
    projectVersion: '1.0'
    extraProperties: 'MyCustomProperty=MyCustomValue'

The task version is 4.17.0 (More Information page):
image

So I think your scannerMode property should be set to MSBuild to run the SonarScanner for AzureDevOps. I am guessing when run in MSBuild mode, it is a wrapper around the SonarScanner for .NET. I bring that up to point out that SonarScanner for .NET does not have any documentation around a sonar-project.properties file, so I don’t think .NET projects use this file.

Update: yeah, @ganncamp just confirmed in another thread that sonar-project.properties are not used in .NET analysis:

3 Likes