Versions Compared

Key

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

...

HTML
<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="https://www.sonarsource.com">SonarSource</a> &#8211; MIT &#8211;
<a target="_top" href="https://github.com/SonarSource/sonar-scanner-msbuild/issues">Issue Tracker</a> &#8211;
<a target="_top" href="https://github.com/SonarSource-VisualStudio/sonar-msbuild-runner">Sources</a>
<br>
<div>
    <div style="padding-top:10px;padding-bottom:5px">
    <span style="font-size:larger;"><strong>SonarScanner for MSBuild 4.6.01.1930<2049</strong></span>
     &#8211; Compatible with SonarQube 6.7+ (LTS)
    <br>
    <a target="_top" href="https://github.com/SonarSource/sonar-scanner-msbuild/releases/download/4.6.01.19302049/sonar-scanner-msbuild-4.6.01.19302049-net46.zip">Download for .NET Framework 4.6+</a><br>
    <a target="_top" href="https://github.com/SonarSource/sonar-scanner-msbuild/releases/download/4.6.01.19302049/sonar-scanner-msbuild-4.6.01.19302049-netcoreapp2.0.zip">Download for .NET Core 2.0+</a><br>
    <a target="_top" href="https://www.nuget.org/packages/dotnet-sonarscanner">Download as a .NET Core Global Tool</a><br>
    </div> 
</div> 
</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

ParameterDescription
/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.
/d:<analysis-parameter>=<value>

[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:

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

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

/d:sonar.password=<password>

[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

 



4.5.0.1761