Getting “The SonarScanner for MSBuild integration failed: SonarCloud was unable to collect the required information about your projects.” exception in Azure DevOps Pipeline for an ASP .NET Core project with this pipeline instructions:
-
task: DotNetCoreCLI@2
inputs:
command: ‘build’ -
task: SonarCloudPrepare@1
inputs:
SonarCloud: ‘SonarCloud’
organization: ‘XX’
scannerMode: ‘MSBuild’
projectKey: ‘XX’
projectName: ‘XX’
extraProperties: |
#sonar.verbose=true
#sonar.debug = true -
task: SonarCloudAnalyze@1
-
task: SonarCloudPublish@1
inputs:
pollingTimeoutSec: ‘300’
We tried to use scannerMode ‘CLI’ which seems to work, but then it just analyses some html files rather than c# solution. Tests are built with Xunit but I guess this isn’t the issue as well.
We are working with a solution file in the root directory of the repository and projects/tests in subdirectories (src/test). Build works. Any ideas?