Until recently SonarQube was working happily in our Azure Dev Ops environment with .Net Core builds, this no longer appears to be the case.
I have attempted to isolate this from our code by creating a new .Net Core console app with:
dotnet new console
Adding a ProjectGuid:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<ProjectGuid>{58bbb3a8-055e-441a-b837-ed148455bb5a}</ProjectGuid>
</PropertyGroup>
</Project>
And creating a new build with the following steps on an Hosted Ubuntu 16.04 Agent
Every time the analysis finishes with the below output:
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 and 15.0 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)
13:27:29.14 Post-processing failed. Exit code: 1
/usr/bin/dotnet failed with return code: 1
Other project types are analysing fine (Angular apps. .Net Framework projects) it is just .Net Core where I am having an issue.
Full output from the Run Analysis step below, one line that did jump out is that the build directory is empty should that be the case?
2018-11-30T13:18:27.4228309Z ##[debug]Evaluating condition for step: 'Run Code Analysis'
2018-11-30T13:18:27.4228701Z ##[debug]Evaluating: succeeded()
2018-11-30T13:18:27.4228965Z ##[debug]Evaluating succeeded:
2018-11-30T13:18:27.4229296Z ##[debug]=> True
2018-11-30T13:18:27.4229467Z ##[debug]Result: True
2018-11-30T13:18:27.4229614Z ##[section]Starting: Run Code Analysis
2018-11-30T13:18:27.4231968Z ==============================================================================
2018-11-30T13:18:27.4232075Z Task : Run Code Analysis
2018-11-30T13:18:27.4232135Z Description : Run scanner and upload the results to the SonarQube server.
2018-11-30T13:18:27.4232193Z Version : 4.4.1
2018-11-30T13:18:27.4232256Z Author : sonarsource
2018-11-30T13:18:27.4232327Z Help : This task is not needed for Maven and Gradle projects since the scanner should be run as part of the build.
[More Information](http://redirect.sonarsource.com/doc/install-configure-scanner-tfs-ts.html)
2018-11-30T13:18:27.4232427Z ==============================================================================
2018-11-30T13:18:27.5376172Z ##[debug]agent.TempDirectory=/home/vsts/work/_temp
2018-11-30T13:18:27.5400710Z ##[debug]loading inputs and endpoints
2018-11-30T13:18:27.5405096Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
2018-11-30T13:18:27.5413771Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
2018-11-30T13:18:27.5416085Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
2018-11-30T13:18:27.5420843Z ##[debug]loading SECRET_SONARQUBE_ENDPOINT
2018-11-30T13:18:27.5421928Z ##[debug]loaded 4
2018-11-30T13:18:27.5435289Z ##[debug]Agent.ProxyUrl=undefined
2018-11-30T13:18:27.5435835Z ##[debug]Agent.CAInfo=undefined
2018-11-30T13:18:27.5436108Z ##[debug]Agent.ClientCert=undefined
2018-11-30T13:18:27.5436330Z ##[debug]Agent.SkipCertValidation=undefined
2018-11-30T13:18:27.5793982Z ##[debug]SONARQUBE_SCANNER_MODE=MSBuild
2018-11-30T13:18:27.5806761Z ##[debug]SONARQUBE_SCANNER_MSBUILD_DLL=/home/vsts/work/_tasks/SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157/4.4.1/dotnet-sonar-scanner-msbuild/SonarScanner.MSBuild.dll
2018-11-30T13:18:27.5808408Z ##[debug]which 'dotnet'
2018-11-30T13:18:27.5815025Z ##[debug]found: '/usr/bin/dotnet'
2018-11-30T13:18:27.5815740Z ##[debug]which 'dotnet'
2018-11-30T13:18:27.5816497Z ##[debug]found: '/usr/bin/dotnet'
2018-11-30T13:18:27.5817053Z ##[debug]which '/usr/bin/dotnet'
2018-11-30T13:18:27.5817439Z ##[debug]found: '/usr/bin/dotnet'
2018-11-30T13:18:27.5818078Z ##[debug]which '/usr/bin/dotnet'
2018-11-30T13:18:27.5818470Z ##[debug]found: '/usr/bin/dotnet'
2018-11-30T13:18:27.5821834Z ##[debug]/usr/bin/dotnet arg: /home/vsts/work/_tasks/SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157/4.4.1/dotnet-sonar-scanner-msbuild/SonarScanner.MSBuild.dll
2018-11-30T13:18:27.5822290Z ##[debug]/usr/bin/dotnet arg: end
2018-11-30T13:18:27.5830183Z ##[debug]exec tool: /usr/bin/dotnet
2018-11-30T13:18:27.5831022Z ##[debug]arguments:
2018-11-30T13:18:27.5831718Z ##[debug] /home/vsts/work/_tasks/SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157/4.4.1/dotnet-sonar-scanner-msbuild/SonarScanner.MSBuild.dll
2018-11-30T13:18:27.5832158Z ##[debug] end
2018-11-30T13:18:27.5837105Z [command]/usr/bin/dotnet /home/vsts/work/_tasks/SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157/4.4.1/dotnet-sonar-scanner-msbuild/SonarScanner.MSBuild.dll end
2018-11-30T13:18:27.6553069Z SonarScanner for MSBuild 4.4.2
2018-11-30T13:18:27.6553802Z Using the .NET Core version of the Scanner for MSBuild
2018-11-30T13:18:27.7197581Z Default properties file was found at /home/vsts/work/_tasks/SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157/4.4.1/dotnet-sonar-scanner-msbuild/SonarQube.Analysis.xml
2018-11-30T13:18:27.7197955Z Loading analysis properties from /home/vsts/work/_tasks/SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157/4.4.1/dotnet-sonar-scanner-msbuild/SonarQube.Analysis.xml
2018-11-30T13:18:27.7198194Z Post-processing started.
2018-11-30T13:18:27.8213824Z 13:18:27.82 Loading the SonarQube analysis config from /home/vsts/work/1/.sonarqube/conf/SonarQubeAnalysisConfig.xml
2018-11-30T13:18:27.8214392Z 13:18:27.821 Not running under TeamBuild
2018-11-30T13:18:27.8217818Z 13:18:27.821 Analysis base directory: /home/vsts/work/1/.sonarqube
**2018-11-30T13:18:27.8217892Z Build directory:**
2018-11-30T13:18:27.8217996Z Bin directory: /home/vsts/work/1/.sonarqube/bin
2018-11-30T13:18:27.8218043Z Config directory: /home/vsts/work/1/.sonarqube/conf
2018-11-30T13:18:27.8218141Z Output directory: /home/vsts/work/1/.sonarqube/out
2018-11-30T13:18:27.8218190Z Config file: /home/vsts/work/1/.sonarqube/conf/SonarQubeAnalysisConfig.xml
2018-11-30T13:18:27.8264472Z Generating SonarQube project properties file to /home/vsts/work/1/.sonarqube/out/sonar-project.properties
2018-11-30T13:18:27.8391670Z ##[error]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 and 15.0 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)
2018-11-30T13:18:27.8401621Z ##[debug]Processed: ##vso[task.logissue type=error;]The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects.%0D%0APossible causes:%0D%0A 1. The project has not been built - the project must be built in between the begin and end steps%0D%0A 2. An unsupported version of MSBuild has been used to build the project. Currently MSBuild 14.0 and 15.0 are supported%0D%0A 3. The begin, build and end steps have not all been launched from the same folder%0D%0A 4. None of the analyzed projects have a valid ProjectGuid and you have not used a solution (.sln)
2018-11-30T13:18:27.8401905Z The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
2018-11-30T13:18:27.8401985Z Possible causes:
2018-11-30T13:18:27.8402911Z 1. The project has not been built - the project must be built in between the begin and end steps
2018-11-30T13:18:27.8403010Z 2. An unsupported version of MSBuild has been used to build the project. Currently MSBuild 14.0 and 15.0 are supported
2018-11-30T13:18:27.8403332Z 3. The begin, build and end steps have not all been launched from the same folder
2018-11-30T13:18:27.8403409Z 4. None of the analyzed projects have a valid ProjectGuid and you have not used a solution (.sln)
2018-11-30T13:18:27.8409862Z Writing processing summary to /home/vsts/work/1/.sonarqube/out/ProjectInfo.log
2018-11-30T13:18:27.8415914Z Generation of the sonar-properties file failed. Unable to complete SonarQube analysis.
2018-11-30T13:18:27.8465914Z 13:18:27.846 Creating a summary markdown file...
2018-11-30T13:18:27.8476467Z ##[error]13:18:27.847 Post-processing failed. Exit code: 1
2018-11-30T13:18:27.8476727Z ##[debug]Processed: ##vso[task.logissue type=error;]13:18:27.847 Post-processing failed. Exit code: 1
2018-11-30T13:18:27.8477042Z 13:18:27.847 Post-processing failed. Exit code: 1
2018-11-30T13:18:27.8556973Z ##[debug]rc:1
2018-11-30T13:18:27.8557156Z ##[debug]success:false
2018-11-30T13:18:27.8588448Z ##[debug]task result: Failed
2018-11-30T13:18:27.8589680Z ##[error]/usr/bin/dotnet failed with return code: 1
2018-11-30T13:18:27.8589916Z ##[debug]Processed: ##vso[task.issue type=error;]/usr/bin/dotnet failed with return code: 1
2018-11-30T13:18:27.8591482Z ##[debug]Processed: ##vso[task.complete result=Failed;]/usr/bin/dotnet failed with return code: 1
2018-11-30T13:18:27.8609182Z ##[section]Finishing: Run Code Analysis
Any ideas as this is driving me insane!
Cheers,
Steven