SonarScanner did not scan the project

i’m new to sonarqube. I watched some videos and tutorials but I couldn’t reach the expected result. It is able to execute all the steps of sonarqube, but in the step where I execute the command SonarScanner.MSBuild.exe end, it simply ends the process and does not scan the project. In the tutorials I saw, he does a great analysis, but in my case he just executes this:

SonarScanner for MSBuild 5.2.1
Using the .NET Framework version of the Scanner for MSBuild
Post-processing started.
Calling the TFS Processor executable …
The TFS Processor has finished
Calling the SonarScanner CLI …
The SonarScanner CLI has finished
20: 46: 27.628 Post-processing succeeded.

I looked about this problem or where I’m going wrong but I couldn’t find anything, if someone can help me, I am grateful.

LOG BEGIN:

SonarScanner for MSBuild 5.2.1
Using the .NET Framework version of the Scanner for MSBuild
Default properties file was found at C:\SonarScanner\SonarQube.Analysis.xml
Loading analysis properties from C:\SonarScanner\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:14:58.009  11:14:58.001  Loading analysis properties from C:\SonarScanner\SonarQube.Analysis.xml
11:14:58.01  11:14:58.009  sonar.verbose=true was specified - setting the log verbosity to 'Debug'
11:14:58.018  Updating build integration targets...
11:14:58.025  The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Users\gmedeiros\AppData\Local\Microsoft\MSBuild\4.0\Microsoft.Common.targets\ImportBefore
11:14:58.027  The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Users\gmedeiros\AppData\Local\Microsoft\MSBuild\10.0\Microsoft.Common.targets\ImportBefore
11:14:58.031  The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Users\gmedeiros\AppData\Local\Microsoft\MSBuild\11.0\Microsoft.Common.targets\ImportBefore
11:14:58.033  The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Users\gmedeiros\AppData\Local\Microsoft\MSBuild\12.0\Microsoft.Common.targets\ImportBefore
11:14:58.036  The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Users\gmedeiros\AppData\Local\Microsoft\MSBuild\14.0\Microsoft.Common.targets\ImportBefore
11:14:58.04  The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Users\gmedeiros\AppData\Local\Microsoft\MSBuild\15.0\Microsoft.Common.targets\ImportBefore
11:14:58.048  The file SonarQube.Integration.ImportBefore.targets is up to date at C:\Users\gmedeiros\AppData\Local\Microsoft\MSBuild\Current\Microsoft.Common.targets\ImportBefore
11:14:58.054  Installed SonarQube.Integration.targets to C:\VisualStudioProjects3\IV.Solucoes\IV.Quitaqui.PaymentRegistry\IV.Quitaqui.PaymentRegistry\.sonarqube\bin\targets
11:14:58.059  Creating config and output folders...
11:14:58.061  Creating directory: C:\VisualStudioProjects3\IV.Solucoes\IV.Quitaqui.PaymentRegistry\IV.Quitaqui.PaymentRegistry\.sonarqube\conf
11:14:58.064  Creating directory: C:\VisualStudioProjects3\IV.Solucoes\IV.Quitaqui.PaymentRegistry\IV.Quitaqui.PaymentRegistry\.sonarqube\out
11:14:58.103  Downloading from http://localhost:9000/api/server/version...
11:14:58.152  Checking validity of server license
11:14:58.156  Downloading from http://localhost:9000/api/editions/is_valid_license...
11:14:58.202  SonarQube Community Edition detected, license is valid.
11:14:58.212  Fetching analysis configuration settings...
11:14:58.218  Fetching properties for project 'IV.Quitaqui.PaymentRegistry' from http://localhost:9000/api/settings/values?component=IV.Quitaqui.PaymentRegistry...
11:14:58.221  Downloading from http://localhost:9000/api/settings/values?component=IV.Quitaqui.PaymentRegistry...
11:14:58.251  Downloading from http://localhost:9000/api/languages/list...
11:14:58.262  Fetching quality profile for project 'IV.Quitaqui.PaymentRegistry' from http://localhost:9000/api/qualityprofiles/search?project=IV.Quitaqui.PaymentRegistry...
11:14:58.266  Downloading from http://localhost:9000/api/qualityprofiles/search?project=IV.Quitaqui.PaymentRegistry...
11:14:58.298  Fetching rules for quality profile 'AXmvywZBfrzCNn9BWR4l' from http://localhost:9000/api/rules/search?f=repo,name,severity,lang,internalKey,templateKey,params,actives&ps=500&qprofile=AXmvywZBfrzCNn9BWR4l&p=1...
11:14:58.3  Downloading from http://localhost:9000/api/rules/search?f=repo,name,severity,lang,internalKey,templateKey,params,actives&ps=500&qprofile=AXmvywZBfrzCNn9BWR4l&p=1...
11:14:58.506  Local analyzer cache: C:\Users\gmedeiros\AppData\Local\Temp\.sonarqube\resources
11:14:58.517  Writing Roslyn generated ruleset to C:\VisualStudioProjects3\IV.Solucoes\IV.Quitaqui.PaymentRegistry\IV.Quitaqui.PaymentRegistry\.sonarqube\conf\Sonar-cs.ruleset...
11:14:58.531  Writing Roslyn generated ruleset to C:\VisualStudioProjects3\IV.Solucoes\IV.Quitaqui.PaymentRegistry\IV.Quitaqui.PaymentRegistry\.sonarqube\conf\Sonar-cs-none.ruleset...
11:14:58.536  Provisioning analyzer assemblies for cs...
11:14:58.538  Installing required Roslyn analyzers...
11:14:58.539  Processing plugin: csharp version 8.22.0.31243
11:14:58.611  Cache hit: using plugin files from C:\Users\gmedeiros\AppData\Local\Temp\.sonarqube\resources\0
11:14:58.613  Processing plugin: vbnet version 8.22.0.31243
11:14:58.618  Cache hit: using plugin files from C:\Users\gmedeiros\AppData\Local\Temp\.sonarqube\resources\1
11:14:58.625  Writing Roslyn analyzer additional file to C:\VisualStudioProjects3\IV.Solucoes\IV.Quitaqui.PaymentRegistry\IV.Quitaqui.PaymentRegistry\.sonarqube\conf\cs\SonarLint.xml...
11:14:58.627  Fetching quality profile for project 'IV.Quitaqui.PaymentRegistry' from http://localhost:9000/api/qualityprofiles/search?project=IV.Quitaqui.PaymentRegistry...
11:14:58.628  Downloading from http://localhost:9000/api/qualityprofiles/search?project=IV.Quitaqui.PaymentRegistry...
11:14:58.65  Fetching rules for quality profile 'AXmvywk3frzCNn9BWSjR' from http://localhost:9000/api/rules/search?f=repo,name,severity,lang,internalKey,templateKey,params,actives&ps=500&qprofile=AXmvywk3frzCNn9BWSjR&p=1...
11:14:58.654  Downloading from http://localhost:9000/api/rules/search?f=repo,name,severity,lang,internalKey,templateKey,params,actives&ps=500&qprofile=AXmvywk3frzCNn9BWSjR&p=1...
11:14:58.736  Local analyzer cache: C:\Users\gmedeiros\AppData\Local\Temp\.sonarqube\resources
11:14:58.738  Writing Roslyn generated ruleset to C:\VisualStudioProjects3\IV.Solucoes\IV.Quitaqui.PaymentRegistry\IV.Quitaqui.PaymentRegistry\.sonarqube\conf\Sonar-vbnet.ruleset...
11:14:58.744  Writing Roslyn generated ruleset to C:\VisualStudioProjects3\IV.Solucoes\IV.Quitaqui.PaymentRegistry\IV.Quitaqui.PaymentRegistry\.sonarqube\conf\Sonar-vbnet-none.ruleset...
11:14:58.746  Provisioning analyzer assemblies for vbnet...
11:14:58.747  Installing required Roslyn analyzers...
11:14:58.747  Processing plugin: csharp version 8.22.0.31243
11:14:58.75  Cache hit: using plugin files from C:\Users\gmedeiros\AppData\Local\Temp\.sonarqube\resources\0
11:14:58.751  Processing plugin: vbnet version 8.22.0.31243
11:14:58.753  Cache hit: using plugin files from C:\Users\gmedeiros\AppData\Local\Temp\.sonarqube\resources\1
11:14:58.755  Writing Roslyn analyzer additional file to C:\VisualStudioProjects3\IV.Solucoes\IV.Quitaqui.PaymentRegistry\IV.Quitaqui.PaymentRegistry\.sonarqube\conf\vbnet\SonarLint.xml...
11:14:58.787  Pre-processing succeeded.

LOGIN END:
SonarScanner for MSBuild 5.2.1
Using the .NET Framework version of the Scanner for MSBuild
Post-processing started.
11:16:01.113  11:16:01.113  sonar.verbose=true was specified - setting the log verbosity to 'Debug'
11:16:01.118  Loading the SonarQube analysis config from C:\VisualStudioProjects3\IV.Solucoes\IV.Quitaqui.PaymentRegistry\IV.Quitaqui.PaymentRegistry\.sonarqube\conf\SonarQubeAnalysisConfig.xml
11:16:01.119  Not running under TeamBuild
11:16:01.12  Analysis base directory: C:\VisualStudioProjects3\IV.Solucoes\IV.Quitaqui.PaymentRegistry\IV.Quitaqui.PaymentRegistry\.sonarqube
Build directory:
Bin directory: C:\VisualStudioProjects3\IV.Solucoes\IV.Quitaqui.PaymentRegistry\IV.Quitaqui.PaymentRegistry\.sonarqube\bin
Config directory: C:\VisualStudioProjects3\IV.Solucoes\IV.Quitaqui.PaymentRegistry\IV.Quitaqui.PaymentRegistry\.sonarqube\conf
Output directory: C:\VisualStudioProjects3\IV.Solucoes\IV.Quitaqui.PaymentRegistry\IV.Quitaqui.PaymentRegistry\.sonarqube\out
Config file: C:\VisualStudioProjects3\IV.Solucoes\IV.Quitaqui.PaymentRegistry\IV.Quitaqui.PaymentRegistry\.sonarqube\conf\SonarQubeAnalysisConfig.xml
11:16:01.131  Generating SonarQube project properties file to C:\VisualStudioProjects3\IV.Solucoes\IV.Quitaqui.PaymentRegistry\IV.Quitaqui.PaymentRegistry\.sonarqube\out\sonar-project.properties
11:16:01.154  Setting analysis property: sonar.visualstudio.enable=false
11:16:01.2  The supplied Code Analysis ErrorLog file is a valid json file and does not need to be fixed: C:\VisualStudioProjects3\IV.Solucoes\IV.Quitaqui.PaymentRegistry\IV.Quitaqui.PaymentRegistry\IV.Quitaqui.PaymentRegistry\bin\IV.Quitaqui.PaymentRegistry.exe.RoslynCA.json
11:16:01.206  The supplied Code Analysis ErrorLog file is a valid json file and does not need to be fixed: C:\VisualStudioProjects3\IV.Solucoes\IV.Quitaqui.PaymentRegistry\IV.Quitaqui.PaymentRegistry\IV.Quitaqui.PaymentRegistry\bin\IV.Quitaqui.PaymentRegistry.exe.RoslynCA.json
11:16:01.222  Using longest common projects root path as project base directory: 'C:\VisualStudioProjects3\IV.Solucoes\IV.Quitaqui.PaymentRegistry\IV.Quitaqui.PaymentRegistry\IV.Quitaqui.PaymentRegistry'.
11:16:01.244  Dumping content of sonar-project.properties
------------------------------------------------------------------------
sonar.projectKey=IV.Quitaqui.PaymentRegistry
sonar.working.directory=C:\\VisualStudioProjects3\\IV.Solucoes\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\.sonarqube\\out\\.sonar
sonar.projectBaseDir=C:\\VisualStudioProjects3\\IV.Solucoes\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry

F6F3623A-13DD-4F56-B6A3-7262899BEB91.sonar.projectKey=IV.Quitaqui.PaymentRegistry:F6F3623A-13DD-4F56-B6A3-7262899BEB91
F6F3623A-13DD-4F56-B6A3-7262899BEB91.sonar.projectName=IV.Quitaqui.PaymentRegistry
F6F3623A-13DD-4F56-B6A3-7262899BEB91.sonar.projectBaseDir=C:\\VisualStudioProjects3\\IV.Solucoes\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry
F6F3623A-13DD-4F56-B6A3-7262899BEB91.sonar.sourceEncoding=utf-8
F6F3623A-13DD-4F56-B6A3-7262899BEB91.sonar.sources=\
"C:\\VisualStudioProjects3\\IV.Solucoes\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\Connectors\\Bradesco\\ConnectorBradescoResponse.vb",\
"C:\\VisualStudioProjects3\\IV.Solucoes\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\Controllers\\wsBradescoRegistryController.vb",\
"C:\\VisualStudioProjects3\\IV.Solucoes\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\My Project\\PaymentConfiguration.vb",\
"C:\\VisualStudioProjects3\\IV.Solucoes\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\ProjectInstaller.Designer.vb",\
"C:\\VisualStudioProjects3\\IV.Solucoes\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\ProjectInstaller.vb",\
"C:\\VisualStudioProjects3\\IV.Solucoes\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\Service.vb",\
"C:\\VisualStudioProjects3\\IV.Solucoes\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\Service.Designer.vb",\
"C:\\VisualStudioProjects3\\IV.Solucoes\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\My Project\\AssemblyInfo.vb",\
"C:\\VisualStudioProjects3\\IV.Solucoes\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\Util\\Util.vb",\
"C:\\VisualStudioProjects3\\IV.Solucoes\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\My Project\\Resources.resx",\
"C:\\VisualStudioProjects3\\IV.Solucoes\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\ProjectInstaller.resx",\
"C:\\VisualStudioProjects3\\IV.Solucoes\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\Configurations.settings",\
"C:\\VisualStudioProjects3\\IV.Solucoes\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\My Project\\Application.myapp",\
"C:\\VisualStudioProjects3\\IV.Solucoes\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\My Project\\Settings.settings",\
"C:\\VisualStudioProjects3\\IV.Solucoes\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\App.config",\
"C:\\VisualStudioProjects3\\IV.Solucoes\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\packages.config"

F6F3623A-13DD-4F56-B6A3-7262899BEB91.sonar.vbnet.analyzer.projectOutPaths=C:\\VisualStudioProjects3\\IV.Solucoes\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\.sonarqube\\out\\0
F6F3623A-13DD-4F56-B6A3-7262899BEB91.sonar.vbnet.roslyn.reportFilePaths=C:\\VisualStudioProjects3\\IV.Solucoes\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\bin\\IV.Quitaqui.PaymentRegistry.exe.RoslynCA.json|C:\\VisualStudioProjects3\\IV.Solucoes\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\bin\\IV.Quitaqui.PaymentRegistry.exe.RoslynCA.json
F6F3623A-13DD-4F56-B6A3-7262899BEB91.sonar.vbnet.analyzer.projectOutPaths=\
"C:\\VisualStudioProjects3\\IV.Solucoes\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\.sonarqube\\out\\0"
F6F3623A-13DD-4F56-B6A3-7262899BEB91.sonar.vbnet.roslyn.reportFilePaths=\
"C:\\VisualStudioProjects3\\IV.Solucoes\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\bin\\IV.Quitaqui.PaymentRegistry.exe.RoslynCA.json"

F6F3623A-13DD-4F56-B6A3-7262899BEB91.sonar.working.directory=C:\\VisualStudioProjects3\\IV.Solucoes\\IV.Quitaqui.PaymentRegistry\\IV.Quitaqui.PaymentRegistry\\.sonarqube\\out\\.sonar\\mod0
sonar.host.url=http://localhost:9000
sonar.visualstudio.enable=false

sonar.modules=F6F3623A-13DD-4F56-B6A3-7262899BEB91


------------------------------------------------------------------------
11:16:01.277  Writing processing summary to C:\VisualStudioProjects3\IV.Solucoes\IV.Quitaqui.PaymentRegistry\IV.Quitaqui.PaymentRegistry\.sonarqube\out\ProjectInfo.log
Calling the TFS Processor executable...
Executing file C:\SonarScanner\SonarScanner.MSBuild.TFSProcessor.exe
  Args: ConvertCoverage C:\VisualStudioProjects3\IV.Solucoes\IV.Quitaqui.PaymentRegistry\IV.Quitaqui.PaymentRegistry\.sonarqube\conf\SonarQubeAnalysisConfig.xml C:\VisualStudioProjects3\IV.Solucoes\IV.Quitaqui.PaymentRegistry\IV.Quitaqui.PaymentRegistry\.sonarqube\out\sonar-project.properties
  Working directory: C:\VisualStudioProjects3\IV.Solucoes\IV.Quitaqui.PaymentRegistry\IV.Quitaqui.PaymentRegistry
  Timeout (ms):-1
  Process id: 14036
Process returned exit code 0
The TFS Processor has finished
Calling the SonarScanner CLI...
Executing file C:\SonarScanner\sonar-scanner-4.6.1.2450\bin\sonar-scanner.bat
  Args: -Dsonar.scanAllFiles=true -Dproject.settings=C:\VisualStudioProjects3\IV.Solucoes\IV.Quitaqui.PaymentRegistry\IV.Quitaqui.PaymentRegistry\.sonarqube\out\sonar-project.properties --from=ScannerMSBuild/5.2.1 --debug <sensitive data removed>
  Working directory: C:\VisualStudioProjects3\IV.Solucoes\IV.Quitaqui.PaymentRegistry\IV.Quitaqui.PaymentRegistry
  Timeout (ms):-1
  Process id: 26220
Process returned exit code 0
The SonarScanner CLI has finished
11:16:01.736  Post-processing succeeded.

Hi,

Welcome to the community!

You mention the end command but what about the begin and build commands? Have you read our docs on this? SonarScanner for .NET | SonarQube Docs

 
Ann

yes, I put the logs there for the begin and end. in the middle of the 2 I ran the build. but as I said the end does nothing, just look at the log. if I run via .bat everything works

Can anyone even help me?

Hi @Guathan_Medeiros

It is able to execute all the steps of sonarqube, but in the step where I execute the command SonarScanner.MSBuild.exe end, it simply ends the process and does not scan the project.

For dotnet projects the analysis is done at the build time. The generated *RoslynCA.json files should contain the warnings which are later uploaded to SonarQube or SonarCloud.

Can you check if you have any results on SonarQube? The analysis seems to be successful.

Thanks,
Costin

There was no result.

If I perform the following steps it doesn’t work:

1- SonarScanner.MSBuild.exe begin /k:“IV.WorkFlow.Solutions” /d:sonar.host.url=“http://localhost:9000” /d:sonar.login=“XXXXXXXXX”

2- SonarScanner.MSBuild.exe end /d:sonar.login=“XXXXXXXXX”

3- SonarScanner.MSBuild.exe end /d:sonar.login=“XXXXXXXX”

In order to work, I need to take one more step, which would be this:

4- C:\SonarScanner\sonar-scanner-4.6.1.2450\bin\sonar-scanner.bat -Dsonar.scanAllFiles=true -Dproject.settings=C:\VisualStudioProjects3\IV.SolucoesIV.WorkFlow.Solutions.sonarqube\out\sonar-project.properties --from=ScannerMSBuild/5.2.1 -Dsonar.login=XXXXXXXXXXX

Hi @Guathan_Medeiros did you manage to resolve this issue? Thanks.