SonarQube was unable to collect the required information about your projects on Mac

Hello, I’m trying to evaluate SonarQube Community so I’m really. just trying to get the simplest example to work.

I have a fresh docker image of SonarQube running locally and Sonar scanner dotnet tool installed along with Java 21 and MSBuild 17.3.2.46306. I downloaded a simple “sample” project to do an analysis on located here: git@github.com:oktadev/dotnet-sonarqube-example.git

My OS is Sonoma 14.1 and this is an M1 Mac

My debug output for the analysis step is below. I just keep getting “The SonarScanner for MSBuild integration failed: SonarQube was unable to collect the required information about your projects.”

Not sure what I’m doing wrong…any help would be much appreciated!!

esamprakos•idexx/sonartest/dotnet-sonarqube-example(main⚡)» dotnet sonarscanner begin /k:"Test-Project" /d:sonar.host.url="http://localhost:9111"  /d:sonar.token="sqp_ef519013c807f5ba8e73ab6d4b2afd5b01c81337" /d:sonar.verbose=true [12:08:51]
SonarScanner for MSBuild 6.0
Using the .NET Core version of the Scanner for MSBuild
Default properties file was found at /Users/esamprakos/.dotnet/tools/.store/dotnet-sonarscanner/6.0.0/dotnet-sonarscanner/6.0.0/tools/netcoreapp3.1/any/SonarQube.Analysis.xml
Loading analysis properties from /Users/esamprakos/.dotnet/tools/.store/dotnet-sonarscanner/6.0.0/dotnet-sonarscanner/6.0.0/tools/netcoreapp3.1/any/SonarQube.Analysis.xml
sonar.verbose=true was specified - setting the log verbosity to 'Debug'
Pre-processing started.
Preparing working directories...
Using environment variables to determine the download directory...
12:09:09.658  12:09:09.569  Loading analysis properties from /Users/esamprakos/.dotnet/tools/.store/dotnet-sonarscanner/6.0.0/dotnet-sonarscanner/6.0.0/tools/netcoreapp3.1/any/SonarQube.Analysis.xml
12:09:09.658  12:09:09.658  sonar.verbose=true was specified - setting the log verbosity to 'Debug'
12:09:09.662  Updating build integration targets...
12:09:09.674  The file SonarQube.Integration.ImportBefore.targets is up to date at /Users/esamprakos/Library/Application Support/Microsoft/MSBuild/4.0/Microsoft.Common.targets/ImportBefore
12:09:09.675  The file SonarQube.Integration.ImportBefore.targets is up to date at /Users/esamprakos/Library/Application Support/Microsoft/MSBuild/10.0/Microsoft.Common.targets/ImportBefore
12:09:09.675  The file SonarQube.Integration.ImportBefore.targets is up to date at /Users/esamprakos/Library/Application Support/Microsoft/MSBuild/11.0/Microsoft.Common.targets/ImportBefore
12:09:09.675  The file SonarQube.Integration.ImportBefore.targets is up to date at /Users/esamprakos/Library/Application Support/Microsoft/MSBuild/12.0/Microsoft.Common.targets/ImportBefore
12:09:09.676  The file SonarQube.Integration.ImportBefore.targets is up to date at /Users/esamprakos/Library/Application Support/Microsoft/MSBuild/14.0/Microsoft.Common.targets/ImportBefore
12:09:09.676  The file SonarQube.Integration.ImportBefore.targets is up to date at /Users/esamprakos/Library/Application Support/Microsoft/MSBuild/15.0/Microsoft.Common.targets/ImportBefore
12:09:09.676  The file SonarQube.Integration.ImportBefore.targets is up to date at /Users/esamprakos/Library/Application Support/Microsoft/MSBuild/Current/Microsoft.Common.targets/ImportBefore
12:09:09.676  The file SonarQube.Integration.ImportBefore.targets is up to date at /Users/esamprakos/Microsoft/MSBuild/15.0/Microsoft.Common.targets/ImportBefore
12:09:09.677  The file SonarQube.Integration.ImportBefore.targets is up to date at /Users/esamprakos/Microsoft/MSBuild/Current/Microsoft.Common.targets/ImportBefore
12:09:09.679  Installed SonarQube.Integration.targets to /Users/esamprakos/idexx/sonartest/dotnet-sonarqube-example/.sonarqube/bin/targets
12:09:09.68  Creating config and output folders...
12:09:09.68  Creating directory: /Users/esamprakos/idexx/sonartest/dotnet-sonarqube-example/.sonarqube/conf
12:09:09.681  Creating directory: /Users/esamprakos/idexx/sonartest/dotnet-sonarqube-example/.sonarqube/out
12:09:09.779  Fetching server version...
12:09:09.782  Downloading from http://localhost:9111/api/server/version...
12:09:09.901  Response received from http://localhost:9111/api/server/version...
12:09:09.905  Checking if the server version is supported...
12:09:09.967  Checking validity of server license...
12:09:09.968  Downloading from http://localhost:9111/api/editions/is_valid_license...
12:09:09.992  Response received from http://localhost:9111/api/editions/is_valid_license...
12:09:10.023  SonarQube Community Edition detected, license is valid.
12:09:10.03  Fetching analysis configuration settings...
12:09:10.033  Fetching properties for project 'Test-Project'...
12:09:10.033  Downloading from http://localhost:9111/api/settings/values?component=Test-Project...
12:09:10.064  Response received from http://localhost:9111/api/settings/values?component=Test-Project...
12:09:10.081  Downloading from http://localhost:9111/api/languages/list...
12:09:10.086  Response received from http://localhost:9111/api/languages/list...
12:09:10.091  Fetching quality profile for project 'Test-Project'...
12:09:10.091  Downloading from http://localhost:9111/api/qualityprofiles/search?project=Test-Project...
12:09:10.112  Response received from http://localhost:9111/api/qualityprofiles/search?project=Test-Project...
12:09:10.12  Fetching rules for quality profile 'AYxpBDTHl8FzCr8k3jhW'...
12:09:10.12  Downloading from http://localhost:9111/api/rules/search?f=repo,name,severity,lang,internalKey,templateKey,params,actives&ps=500&qprofile=AYxpBDTHl8FzCr8k3jhW&p=1...
12:09:10.35  Response received from http://localhost:9111/api/rules/search?f=repo,name,severity,lang,internalKey,templateKey,params,actives&ps=500&qprofile=AYxpBDTHl8FzCr8k3jhW&p=1...
12:09:10.378  Local analyzer cache: /var/folders/bm/n8h6tmqj7_l5hj31d44bydzr0000gq/T/.sonarqube/resources
12:09:10.385  Writing Roslyn generated ruleset to /Users/esamprakos/idexx/sonartest/dotnet-sonarqube-example/.sonarqube/conf/Sonar-cs.ruleset...
12:09:10.406  Writing Roslyn generated ruleset to /Users/esamprakos/idexx/sonartest/dotnet-sonarqube-example/.sonarqube/conf/Sonar-cs-none.ruleset...
12:09:10.41  Provisioning analyzer assemblies for cs...
12:09:10.411  Installing required Roslyn analyzers...
12:09:10.412  Processing plugin: csharp version 9.13.0.79967
12:09:10.547  Cache hit: using plugin files from /var/folders/bm/n8h6tmqj7_l5hj31d44bydzr0000gq/T/.sonarqube/resources/0
12:09:10.548  Processing plugin: vbnet version 9.13.0.79967
12:09:10.557  Cache hit: using plugin files from /var/folders/bm/n8h6tmqj7_l5hj31d44bydzr0000gq/T/.sonarqube/resources/1
12:09:10.563  Writing Roslyn analyzer additional file to /Users/esamprakos/idexx/sonartest/dotnet-sonarqube-example/.sonarqube/conf/cs/SonarLint.xml...
12:09:10.565  Fetching quality profile for project 'Test-Project'...
12:09:10.565  Downloading from http://localhost:9111/api/qualityprofiles/search?project=Test-Project...
12:09:10.582  Response received from http://localhost:9111/api/qualityprofiles/search?project=Test-Project...
12:09:10.583  Fetching rules for quality profile 'AYxpBDOol8FzCr8k3jI1'...
12:09:10.583  Downloading from http://localhost:9111/api/rules/search?f=repo,name,severity,lang,internalKey,templateKey,params,actives&ps=500&qprofile=AYxpBDOol8FzCr8k3jI1&p=1...
12:09:10.697  Response received from http://localhost:9111/api/rules/search?f=repo,name,severity,lang,internalKey,templateKey,params,actives&ps=500&qprofile=AYxpBDOol8FzCr8k3jI1&p=1...
12:09:10.703  Local analyzer cache: /var/folders/bm/n8h6tmqj7_l5hj31d44bydzr0000gq/T/.sonarqube/resources
12:09:10.704  Writing Roslyn generated ruleset to /Users/esamprakos/idexx/sonartest/dotnet-sonarqube-example/.sonarqube/conf/Sonar-vbnet.ruleset...
12:09:10.706  Writing Roslyn generated ruleset to /Users/esamprakos/idexx/sonartest/dotnet-sonarqube-example/.sonarqube/conf/Sonar-vbnet-none.ruleset...
12:09:10.707  Provisioning analyzer assemblies for vbnet...
12:09:10.707  Installing required Roslyn analyzers...
12:09:10.707  Processing plugin: csharp version 9.13.0.79967
12:09:10.709  Cache hit: using plugin files from /var/folders/bm/n8h6tmqj7_l5hj31d44bydzr0000gq/T/.sonarqube/resources/0
12:09:10.709  Processing plugin: vbnet version 9.13.0.79967
12:09:10.72  Cache hit: using plugin files from /var/folders/bm/n8h6tmqj7_l5hj31d44bydzr0000gq/T/.sonarqube/resources/1
12:09:10.722  Writing Roslyn analyzer additional file to /Users/esamprakos/idexx/sonartest/dotnet-sonarqube-example/.sonarqube/conf/vbnet/SonarLint.xml...
12:09:10.866  Processing analysis cache
12:09:10.87  Incremental PR analysis: Base branch parameter was not provided.
12:09:10.87  Cache data is empty. A full analysis will be performed.
12:09:10.918  Pre-processing succeeded.
esamprakos•idexx/sonartest/dotnet-sonarqube-example(main⚡)» dotnet build                                                                                                                                                               [12:09:11]
MSBuild version 17.3.2+561848881 for .NET
  Determining projects to restore...
/usr/local/share/dotnet/sdk/6.0.414/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.EolTargetFrameworks.targets(29,5): warning NETSDK1138: The target framework 'net5.0' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy. [/Users/esamprakos/idexx/sonartest/dotnet-sonarqube-example/SampleApp.csproj]
  Restored /Users/esamprakos/idexx/sonartest/dotnet-sonarqube-example/SampleApp.csproj (in 140 ms).
/usr/local/share/dotnet/sdk/6.0.414/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.EolTargetFrameworks.targets(29,5): warning NETSDK1138: The target framework 'net5.0' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy. [/Users/esamprakos/idexx/sonartest/dotnet-sonarqube-example/SampleApp.csproj]
  SampleApp -> /Users/esamprakos/idexx/sonartest/dotnet-sonarqube-example/bin/Debug/net5.0/SampleApp.dll

Build succeeded.

/usr/local/share/dotnet/sdk/6.0.414/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.EolTargetFrameworks.targets(29,5): warning NETSDK1138: The target framework 'net5.0' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy. [/Users/esamprakos/idexx/sonartest/dotnet-sonarqube-example/SampleApp.csproj]
/usr/local/share/dotnet/sdk/6.0.414/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.EolTargetFrameworks.targets(29,5): warning NETSDK1138: The target framework 'net5.0' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy. [/Users/esamprakos/idexx/sonartest/dotnet-sonarqube-example/SampleApp.csproj]
    2 Warning(s)
    0 Error(s)

Time Elapsed 00:00:01.87
esamprakos•idexx/sonartest/dotnet-sonarqube-example(main⚡)» dotnet sonarscanner end /d:sonar.token="sqp_ef519013c807f5ba8e73ab6d4b2afd5b01c81337"                                                                                      [12:09:16]
SonarScanner for MSBuild 6.0
Using the .NET Core version of the Scanner for MSBuild
Post-processing started.
12:09:22.26  12:09:22.253  Uninstalling target: /Users/esamprakos/idexx/sonartest/dotnet-sonarqube-example/.sonarqube/bin/targets/SonarQube.Integration.targets
12:09:22.26  12:09:22.26  sonar.verbose=true was specified - setting the log verbosity to 'Debug'
12:09:22.261  Loading the SonarQube analysis config from /Users/esamprakos/idexx/sonartest/dotnet-sonarqube-example/.sonarqube/conf/SonarQubeAnalysisConfig.xml
12:09:22.261  Not running under TeamBuild
12:09:22.261  Analysis base directory: /Users/esamprakos/idexx/sonartest/dotnet-sonarqube-example/.sonarqube
Build directory: 
Bin directory: /Users/esamprakos/idexx/sonartest/dotnet-sonarqube-example/.sonarqube/bin
Config directory: /Users/esamprakos/idexx/sonartest/dotnet-sonarqube-example/.sonarqube/conf
Output directory: /Users/esamprakos/idexx/sonartest/dotnet-sonarqube-example/.sonarqube/out
Config file: /Users/esamprakos/idexx/sonartest/dotnet-sonarqube-example/.sonarqube/conf/SonarQubeAnalysisConfig.xml
12:09:22.264  Generating SonarQube project properties file to /Users/esamprakos/idexx/sonartest/dotnet-sonarqube-example/.sonarqube/out/sonar-project.properties
12:09:22.269  The SonarScanner for MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
Possible causes:
  1. The project has not been built - the project must be built in between the begin and end steps
  2. An unsupported version of MSBuild has been used to build the project. Currently MSBuild 14.0.25420.1 and higher are supported.
  3. The begin, build and end steps have not all been launched from the same folder
  4. None of the analyzed projects have a valid ProjectGuid and you have not used a solution (.sln)
12:09:22.269  Generation of the sonar-properties file failed. Unable to complete the analysis.
12:09:22.274  Writing processing summary to /Users/esamprakos/idexx/sonartest/dotnet-sonarqube-example/.sonarqube/out/ProjectInfo.log
12:09:22.275  Post-processing failed. Exit code: 1

Hey there.

I’m not facing any issues with that same project – and as far as I can tell, the most meaningful difference I see is a change in the MSBuild version.

On my machine (M2 Mac, Sonoma 14.2):
MSBuild version 17.8.0+6cdef4241 for .NET

Can you make sure you’re using the latest version of MSBuild?

Ah…I was running dotnet 6 (I have no idea how to update just msbuild)…I installed dotnet 8 sdk and now it works…thanks!!