SonarCloud stays empty after running sonar-scanner

Hello, I am trying to get my dot net core code analised and sent to sonarCloud. Everything seems to runs smoothly but sonarCloud keeps showing no data:

dotnet-sonarscanner /k:Lobosque_ts-backend /o:lobosque /d:sonar.sources=. / /d:sonar.login=xxx

Output then is:

SonarScanner for MSBuild 4.6.2
Using the .NET Core version of the Scanner for MSBuild
WARNING: Please specify the command 'begin' or 'end' to indicate whether pre- or post-processing is required. These parameters will become mandatory in a later release.
Pre-processing started.
Preparing working directories...
22:34:03.145  Updating build integration targets...
22:34:03.439  Fetching analysis configuration settings...
22:34:26.485  Provisioning analyzer assemblies for cs...
22:34:26.488  Installing required Roslyn analyzers...
22:34:32.45  Provisioning analyzer assemblies for vbnet...
22:34:32.452  Installing required Roslyn analyzers...
22:34:32.583  Pre-processing succeeded.

What else do I need to run in order to the report data on SonarCloud?


In your command you didn’t specify the “begin” step. Also, you don’t need to set the sonar.sources property. The “corrected” command is:

dotnet sonarscanner begin /k:Lobosque_ts-backend /o:lobosque / /d:sonar.login=xxx

Then you must build your project and run the “end” step. :wink:

For reference:

The .NET Core version can also be used as a .NET Core Global Tool. After installing the Scanner as a global tool as described above it can be invoked as follows:

dotnet sonarscanner begin /k:"project-key" 
dotnet build <path to solution.sln>
dotnet sonarscanner end 

Same as above, if you are targetting a SonarCloud project, will have to add both the organization and a login for authentication.