I am getting this error while trying to execute SonarScanner

I am new to SonarQube and trying to execute the analysis using SonarScanner.MsBuild.

  • ALM used (Azure DevOps)
  • CI system used (Azure DevOps)
  • Scanner command used when applicable (private details masked)
  • Languages of the repository :C#

Error
SonarScanner for MSBuild 9.0.2
Using the .NET Framework version of the Scanner for MSBuild
Post-processing started.
14:50:54.229 Starting with Scanner for .NET v8 the way the sonar.projectBaseDir property is automatically detected has changed and this has an impact on the files that are analyzed and other properties that are resolved relative to it like sonar.exclusions and sonar.test.exclusions. If you would like to customize the behavior, please set the sonar.projectBaseDir property to point to a directory that contains all the source code you want to analyze. The path may be relative (to the directory from which the analysis was started) or absolute.
Calling the TFS Processor executable…
The TFS Processor has finished
Calling the SonarScanner CLI…
INFO: Scanner configuration file: D:\sonar-scanner-9.0.2.104486-net-framework\sonar-scanner-5.0.1.3006\bin..\conf\sonar-scanner.properties
INFO: Project root configuration file: C:\KS\POCs\CCFB\CCFB_VO_Daily\Application\CCFB_VO_Daily.sonarqube\out\sonar-project.properties
INFO: SonarScanner 5.0.1.3006
INFO: Java 17.0.11 Eclipse Adoptium (64-bit)
INFO: Windows 11 10.0 amd64
INFO: User cache: C:\Users\khana.sonar\cache
INFO: Analyzing on SonarCloud
INFO: Default locale: “en_US”, source code encoding: “windows-1252” (analysis is platform dependent)
INFO: Load global settings
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 3.164s
INFO: Final Memory: 7M/56M
ERROR: Error during SonarScanner execution
ERROR: Project not found. Please check the ‘sonar.projectKey’ and ‘sonar.organization’ properties, the ‘SONAR_TOKEN’ environment variable, or contact the project administrator to check the permissions of the user the token belongs to
ERROR:
INFO: ------------------------------------------------------------------------
The SonarScanner did not complete successfully
14:50:59.206 Post-processing failed. Exit code: 1

Hey there.

Have you followed the documentation for using the Azure DevOps Extension for SonarQube Cloud?

If you’re still stuck, can you share your complete Azure DevOps Pipeline YML?