Skip to content
thesarfo

Concept

SonarQube

Running the Sonar Scanner against a local SonarQube server for a .NET project.

views 0

How to run Sonar Scanner in a .NET project

This assumes you already have a local Sonar server running through Docker on port 9000.

Terminal window
dotnet sonarscanner begin /k:"my_project_key" /d:sonar.host.url="http://localhost:9000" /d:sonar.login="my_token"

Run dotnet build, necessary before analysis.

After the build is done, use the following command to complete the analysis and push the results to SonarQube:

Terminal window
dotnet sonarscanner end /d:sonar.login="your_token"