SonarQube analysis could not be completed because the analysis configuration file could not be foun

Please help to resolve below issue. Thanks in advance.

  • We are using sonarqube on-premise solution in our Azure Cloud
    SonarQube ID information
    Server ID: 86E1FA4D-AXcAcDG1K9nWjLQUuTIu
    Version: 8.5.1.38104

SonarScanner for MSBuild 5.9.1
Using the .NET Core version of the Scanner for MSBuild

*We are evaluating SonarQube Scanner with AzurePipeline with simple .net application.

image

I have attached the pipeline yaml file here with.
azure-pipeline.zip (1.0 KB)

*Azure Pipeline Failing Job
displayName: ‘Build test and analyzer’

  • Issue

*Beginning of the Failing Task

SonarScanner for MSBuild 5.9.1
Using the .NET Core version of the Scanner for MSBuild
Pre-processing started.
Preparing working directories…
19:41:53.559 19:41:53.558 Unable to find the analysis settings file ‘C:\Users\dhanuka84\agent_work\1\ .sonarqube\SonarQube.Custom.xml’. Please fix the path to this settings file.
19:41:53.559 Expecting at least the following command line argument:

  • SonarQube/SonarCloud project key
    The full path to a settings file can also be supplied. If it is not supplied, the exe will attempt to locate a default settings file in the same directory as the SonarQube Scanner for MSBuild.
    Use ‘/?’ or ‘/h’ to see the help message.
    19:41:53.56 Pre-processing failed. Exit code: 1
    MSBuild version 17.3.2+561848881 for .NET
    Determining projects to restore…
    All projects are up-to-date for restore.
    SampleLibrary → C:\Users\dhanuka84\agent_work\1\s\src\SampleLibrary\bin\Debug\net6.0\SampleLibrary.dll

Build succeeded.
0 Warning(s)
0 Error(s)

*End of the failing Task

Pipeline failed due to below error at the end of the task
Passed! - Failed: 0, Passed: 1, Skipped: 0, Total: 1, Duration: < 1 ms - SampleLibrary.Tests.dll (net6.0)
Code coverage results: coverage.xml.
SonarScanner for MSBuild 5.9.1
Using the .NET Core version of the Scanner for MSBuild
19:42:00.533 SonarQube analysis could not be completed because the analysis configuration file could not be found: C:\Users\dhanuka84\agent_work\1.sonarqube\conf\SonarQubeAnalysisConfig.xml.
Post-processing started.
19:42:00.534 Post-processing failed. Exit code: 1
##[error]PowerShell exited with code ‘1’.

*Observation

  1. Azure Agent VM machine - This is the agent file structure

image

  1. The custom configuration file is successfully copied

PS C:\Users\dhanuka84\agent_work\1> cd ..sonarqube
PS C:\Users\dhanuka84\agent_work\1.sonarqube> ls

Directory: C:\Users\dhanuka84\agent\_work\1\.sonarqube

Mode LastWriteTime Length Name


d----- 12/9/2022 7:41 PM bin
-a---- 12/9/2022 7:41 PM 408 SonarQube.Custom.xml

PS C:\Users\dhanuka84\agent_work\1.sonarqube>

  1. Content of scanner bin folder

image

Hi,

Your version is past EOL. You should upgrade to either the latest version or the current LTS at your earliest convenience. Your upgrade path is:

8.5.1-> 8.9.10 → 9.7.1 (last step optional)

You may find the Upgrade Guide and the LTS-to-LTS Upgrade Notes helpful. If you have questions about upgrading, feel free to open a new thread for that here.

If your error persists after upgrade, please come back to us.