Hello,
I have the same problem, and I try to solve it but I didn’t find a solution, someone have explication?
Information:
I got this package https://github.com/SonarSource/sonar-scanner-msbuild/releases/download/4.7.1.2311/sonar-scanner-msbuild-4.7.1.2311-netcoreapp2.0.zip from SonarScanner for .NET | SonarQube Docs
And I followed all instructions, and change some things but don’t works.
I’m running this on gitlab with image: mcr.microsoft.com/dotnet/core/sdk:3.0-alpine3.9
$ chmod +x ./install-sonar
$ PATH=$PATH:`pwd`/install-sonar
$ dotnet ./install-sonar/SonarScanner.MSBuild.dll begin /k:"dot-hello" /d:sonar.verbose=true
SonarScanner for MSBuild 4.7.1
Using the .NET Core version of the Scanner for MSBuild
Default properties file was found at /builds/toto/obs-ci-dotnet/install-sonar/SonarQube.Analysis.xml
Loading analysis properties from /builds/toto/obs-ci-dotnet/install-sonar/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...
11:32:21.307 11:32:21.299 Loading analysis properties from /builds/toto/obs-ci-dotnet/install-sonar/SonarQube.Analysis.xml
11:32:21.307 11:32:21.307 sonar.verbose=true was specified - setting the log verbosity to 'Debug'
11:32:21.309 Updating build integration targets...
11:32:21.316 Installed SonarQube.Integration.ImportBefore.targets to /root/.local/share/Microsoft/MSBuild/4.0/Microsoft.Common.targets/ImportBefore
11:32:21.316 Installed SonarQube.Integration.ImportBefore.targets to /root/.local/share/Microsoft/MSBuild/10.0/Microsoft.Common.targets/ImportBefore
11:32:21.317 Installed SonarQube.Integration.ImportBefore.targets to /root/.local/share/Microsoft/MSBuild/11.0/Microsoft.Common.targets/ImportBefore
11:32:21.317 Installed SonarQube.Integration.ImportBefore.targets to /root/.local/share/Microsoft/MSBuild/12.0/Microsoft.Common.targets/ImportBefore
11:32:21.317 Installed SonarQube.Integration.ImportBefore.targets to /root/.local/share/Microsoft/MSBuild/14.0/Microsoft.Common.targets/ImportBefore
11:32:21.317 Installed SonarQube.Integration.ImportBefore.targets to /root/.local/share/Microsoft/MSBuild/15.0/Microsoft.Common.targets/ImportBefore
11:32:21.318 Installed SonarQube.Integration.ImportBefore.targets to /root/.local/share/Microsoft/MSBuild/Current/Microsoft.Common.targets/ImportBefore
11:32:21.318 Installed SonarQube.Integration.ImportBefore.targets to /root/Microsoft/MSBuild/15.0/Microsoft.Common.targets/ImportBefore
11:32:21.318 Installed SonarQube.Integration.ImportBefore.targets to /root/Microsoft/MSBuild/Current/Microsoft.Common.targets/ImportBefore
11:32:21.319 Installed SonarQube.Integration.targets to /builds/toto/obs-ci-dotnet/.sonarqube/bin/targets
11:32:21.32 Creating config and output folders...
11:32:21.321 Creating directory: /builds/toto/obs-ci-dotnet/.sonarqube/conf
11:32:21.321 Creating directory: /builds/toto/obs-ci-dotnet/.sonarqube/out
11:32:21.365 Fetching analysis configuration settings...
11:32:21.366 Downloading from 'begin_of_url'10.0.0.1/api/server/version...
11:32:21.534 Fetching properties for project 'dot-hello' from 'begin_of_url'10.0.0.1/api/settings/values?component=dot-hello...
11:32:21.534 Downloading from 'begin_of_url'10.0.0.1/api/settings/values?component=dot-hello...
11:32:21.699 Downloading from 'begin_of_url'10.0.0.1/api/languages/list...
11:32:21.719 Fetching quality profile for project 'dot-hello' from 'begin_of_url'10.0.0.1/api/qualityprofiles/search?projectKey=dot-hello...
11:32:21.72 Downloading from 'begin_of_url'10.0.0.1/api/qualityprofiles/search?projectKey=dot-hello...
11:32:21.756 Fetching active rules for quality profile 'AW3U9Y7NTrH1UpIec8Sj' from 'begin_of_url'10.0.0.1/api/rules/search?f=repo,name,severity,lang,internalKey,templateKey,params,actives&ps=500&activation=true&qprofile=AW3U9Y7NTrH1UpIec8Sj&p=1...
11:32:21.757 Downloading from 'begin_of_url'10.0.0.1/api/rules/search?f=repo,name,severity,lang,internalKey,templateKey,params,actives&ps=500&activation=true&qprofile=AW3U9Y7NTrH1UpIec8Sj&p=1...
11:32:21.846 Fetching rules not active in quality profile 'AW3U9Y7NTrH1UpIec8Sj' for language 'cs' from 'begin_of_url'10.0.0.1/api/rules/search?f=repo,name,severity,lang,internalKey,templateKey,params&ps=500&activation=false&qprofile=AW3U9Y7NTrH1UpIec8Sj&p=1&languages=cs...
11:32:21.847 Downloading from 'begin_of_url'10.0.0.1/api/rules/search?f=repo,name,severity,lang,internalKey,templateKey,params&ps=500&activation=false&qprofile=AW3U9Y7NTrH1UpIec8Sj&p=1&languages=cs...
11:32:21.892 Local analyzer cache: /tmp/.sonarqube/resources
11:32:21.904 Writing Roslyn generated ruleset to /builds/toto/obs-ci-dotnet/.sonarqube/conf/SonarQubeRoslyn-cs.ruleset...
11:32:21.922 Writing Roslyn generated ruleset to /builds/toto/obs-ci-dotnet/.sonarqube/conf/SonarQubeRoslyn-cs-test.ruleset...
11:32:21.926 Provisioning analyzer assemblies for cs...
11:32:21.927 Installing required Roslyn analyzers...
11:32:21.928 Processing plugin: csharp version 7.15.0.8572
11:32:22.024 Cache miss: plugin files were not found in the local cache
11:32:22.03 Fetching resource for plugin: csharp, version 7.15.0.8572. Resource: SonarAnalyzer-7.15.0.8572.zip
11:32:22.031 Downloading SonarAnalyzer-7.15.0.8572.zip from 'begin_of_url'10.0.0.1/static/csharp/SonarAnalyzer-7.15.0.8572.zip to /tmp/.sonarqube/resources/0
11:32:22.031 Downloading file from 'begin_of_url'10.0.0.1/static/csharp/SonarAnalyzer-7.15.0.8572.zip to /tmp/.sonarqube/resources/0/SonarAnalyzer-7.15.0.8572.zip...
11:32:22.101 Extracting files to /tmp/.sonarqube/resources/0...
11:32:22.141 Processing plugin: vbnet version 7.15.0.8572
11:32:22.161 Cache miss: plugin files were not found in the local cache
11:32:22.161 Fetching resource for plugin: vbnet, version 7.15.0.8572. Resource: SonarAnalyzer-7.15.0.8572.zip
11:32:22.161 Downloading SonarAnalyzer-7.15.0.8572.zip from 'begin_of_url'10.0.0.1/static/vbnet/SonarAnalyzer-7.15.0.8572.zip to /tmp/.sonarqube/resources/1
11:32:22.161 Downloading file from 'begin_of_url'10.0.0.1/static/vbnet/SonarAnalyzer-7.15.0.8572.zip to /tmp/.sonarqube/resources/1/SonarAnalyzer-7.15.0.8572.zip...
11:32:22.216 Extracting files to /tmp/.sonarqube/resources/1...
11:32:22.232 Writing Roslyn analyzer additional file to /builds/toto/obs-ci-dotnet/.sonarqube/conf/cs/SonarLint.xml...
11:32:22.233 Fetching quality profile for project 'dot-hello' from 'begin_of_url'10.0.0.1/api/qualityprofiles/search?projectKey=dot-hello...
11:32:22.233 Downloading from 'begin_of_url'10.0.0.1/api/qualityprofiles/search?projectKey=dot-hello...
11:32:22.264 Fetching active rules for quality profile 'AW3U9ZUeTrH1UpIec8qn' from 'begin_of_url'10.0.0.1/api/rules/search?f=repo,name,severity,lang,internalKey,templateKey,params,actives&ps=500&activation=true&qprofile=AW3U9ZUeTrH1UpIec8qn&p=1...
11:32:22.264 Downloading from 'begin_of_url'10.0.0.1/api/rules/search?f=repo,name,severity,lang,internalKey,templateKey,params,actives&ps=500&activation=true&qprofile=AW3U9ZUeTrH1UpIec8qn&p=1...
11:32:22.308 Fetching rules not active in quality profile 'AW3U9ZUeTrH1UpIec8qn' for language 'vbnet' from 'begin_of_url'10.0.0.1/api/rules/search?f=repo,name,severity,lang,internalKey,templateKey,params&ps=500&activation=false&qprofile=AW3U9ZUeTrH1UpIec8qn&p=1&languages=vbnet...
11:32:22.308 Downloading from 'begin_of_url'10.0.0.1/api/rules/search?f=repo,name,severity,lang,internalKey,templateKey,params&ps=500&activation=false&qprofile=AW3U9ZUeTrH1UpIec8qn&p=1&languages=vbnet...
11:32:22.334 Local analyzer cache: /tmp/.sonarqube/resources
11:32:22.335 Writing Roslyn generated ruleset to /builds/toto/obs-ci-dotnet/.sonarqube/conf/SonarQubeRoslyn-vbnet.ruleset...
11:32:22.336 Writing Roslyn generated ruleset to /builds/toto/obs-ci-dotnet/.sonarqube/conf/SonarQubeRoslyn-vbnet-test.ruleset...
11:32:22.336 Provisioning analyzer assemblies for vbnet...
11:32:22.336 Installing required Roslyn analyzers...
11:32:22.336 Processing plugin: csharp version 7.15.0.8572
11:32:22.337 Cache hit: using plugin files from /tmp/.sonarqube/resources/0
11:32:22.337 Processing plugin: vbnet version 7.15.0.8572
11:32:22.338 Cache hit: using plugin files from /tmp/.sonarqube/resources/1
11:32:22.339 Writing Roslyn analyzer additional file to /builds/toto/obs-ci-dotnet/.sonarqube/conf/vbnet/SonarLint.xml...
11:32:22.378 Pre-processing succeeded.
$ dotnet build dot-hello.sln
Microsoft (R) Build Engine version 16.3.2+e481bbf88 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restore completed in 106.06 ms for /builds/toto/obs-ci-dotnet/myWebApp/myWebApp.csproj.
Build selected
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:01.25
$ dotnet ./install-sonar/SonarScanner.MSBuild.dll end
SonarScanner for MSBuild 4.7.1
Using the .NET Core version of the Scanner for MSBuild
Post-processing started.
11:32:25.234 11:32:25.229 Uninstalling target: /root/.local/share/Microsoft/MSBuild/4.0/Microsoft.Common.targets/ImportBefore\SonarQube.Integration.ImportBefore.targets
11:32:25.234 11:32:25.23 Uninstalling target: /root/.local/share/Microsoft/MSBuild/10.0/Microsoft.Common.targets/ImportBefore\SonarQube.Integration.ImportBefore.targets
11:32:25.234 11:32:25.231 Uninstalling target: /root/.local/share/Microsoft/MSBuild/11.0/Microsoft.Common.targets/ImportBefore\SonarQube.Integration.ImportBefore.targets
11:32:25.234 11:32:25.231 Uninstalling target: /root/.local/share/Microsoft/MSBuild/12.0/Microsoft.Common.targets/ImportBefore\SonarQube.Integration.ImportBefore.targets
11:32:25.234 11:32:25.231 Uninstalling target: /root/.local/share/Microsoft/MSBuild/14.0/Microsoft.Common.targets/ImportBefore\SonarQube.Integration.ImportBefore.targets
11:32:25.234 11:32:25.231 Uninstalling target: /root/.local/share/Microsoft/MSBuild/15.0/Microsoft.Common.targets/ImportBefore\SonarQube.Integration.ImportBefore.targets
11:32:25.234 11:32:25.231 Uninstalling target: /root/.local/share/Microsoft/MSBuild/Current/Microsoft.Common.targets/ImportBefore\SonarQube.Integration.ImportBefore.targets
11:32:25.234 11:32:25.231 Uninstalling target: /root/Microsoft/MSBuild/15.0/Microsoft.Common.targets/ImportBefore\SonarQube.Integration.ImportBefore.targets
11:32:25.234 11:32:25.231 Uninstalling target: /root/Microsoft/MSBuild/Current/Microsoft.Common.targets/ImportBefore\SonarQube.Integration.ImportBefore.targets
11:32:25.234 11:32:25.234 sonar.verbose=true was specified - setting the log verbosity to 'Debug'
11:32:25.235 Loading the SonarQube analysis config from /builds/toto/obs-ci-dotnet/.sonarqube/conf/SonarQubeAnalysisConfig.xml
11:32:25.235 Not running under TeamBuild
11:32:25.235 Analysis base directory: /builds/toto/obs-ci-dotnet/.sonarqube
Build directory:
Bin directory: /builds/toto/obs-ci-dotnet/.sonarqube/bin
Config directory: /builds/toto/obs-ci-dotnet/.sonarqube/conf
Output directory: /builds/toto/obs-ci-dotnet/.sonarqube/out
Config file: /builds/toto/obs-ci-dotnet/.sonarqube/conf/SonarQubeAnalysisConfig.xml
Generating SonarQube project properties file to /builds/toto/obs-ci-dotnet/.sonarqube/out/sonar-project.properties
The SonarQube 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)
Writing processing summary to /builds/toto/obs-ci-dotnet/.sonarqube/out/ProjectInfo.log
Generation of the sonar-properties file failed. Unable to complete SonarQube analysis.
11:32:25.254 Post-processing failed. Exit code: 1
Running after script...
$ cat /builds/toto/obs-ci-dotnet/.sonarqube/out/ProjectInfo.log
Product projects
---------------------------------------
Test projects
---------------------------------------
Invalid projects
---------------------------------------
{none}
Skipped projects
---------------------------------------
{none}
Excluded projects
---------------------------------------
{none}
ERROR: Job failed: exit code 1