Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Changed version to


<div class="table-wrap"><table style="line-height: 1.4285715;" class="confluenceTable"><tbody><tr><td class="highlight-grey confluenceTd" data-highlight-colour="grey">By <a target="_top" href="">SonarSource</a> &#8211; MIT &#8211;
<a target="_top" href="">Issue Tracker</a> &#8211;
<a target="_top" href="">Sources</a>
    <div style="padding-top:10px;padding-bottom:5px">
    <span style="font-size:larger;"><strong>SonarScanner for MSBuild<2049</strong></span>
     &#8211; Compatible with SonarQube 6.7+ (LTS)
    <a target="_top" href="">Download for .NET Framework 4.6+</a><br>
    <a target="_top" href="">Download for .NET Core 2.0+</a><br>
    <a target="_top" href="">Download as a .NET Core Global Tool</a><br>
</div> </td></tr></tbody></table></div>


The begin step is executed when you add the `begin` command line argument. It hooks into the MSBuild pipeline, downloads SonarQube quality profiles, settings and prepares your project for the analysis.

Command Line Parameters

/k:<project-key>[required] Specifies the key of the analyzed project in SonarQube
/n:<project name>[optional] Specifies the name of the analyzed project in SonarQube. Adding this argument will overwrite the project name in SonarQube if it already exists.
/v:<version>[recommended] Specifies the version of your project.

[optional] Specifies additional SonarQube analysis parameter, you could add this argument multiple times. The most commonly used parameters are:

  • /d:sonar.login=<username> or <token> [optional] Specifies the username or access token to authenticate with to SonarQube. If this argument is added to the begin step, it must also be added on the end step.

  • /d:sonar.password=<password> - [optional] Specifies the password for the SonarQube username in the `sonar.login` argument. This argument is not needed if you use authentication token. If this argument is added to the begin step, it must also be added on the end step.

  • /d:sonar.verbose=true - [optional] Sets the logging verbosity to detailed. Add this argument before sending logs for troubleshooting.

For detailed information about all available parameters, see Analysis Parameters

(warning) The "begin" step will modify your build like this:


There are only two additional arguments that are allowed for the end step:

/d:sonar.login=<username> or <token>

[optional] This argument is required if it is added to the begin step.


[optional] This argument is required if it is added to the begin step and not required if you are using <token>

Known Limitations

  • MSBuild versions older than 14 are not supported.
  • Web Application projects are supported. Legacy Web Site projects are not. 
  • Projects targeting multiple frameworks and using preprocessor directives could have slightly inaccurate metrics (lines of code, complexity, etc.) because the metrics are calculated only from the first of the built targets.

Going Further

Children Display