Skip to end of metadata
Go to start of metadata

Prerequisites

You must have previously installed and configured SonarQube Scanner for MSBuild and read Analyzing Code Source.

Steps to Analyze a Project from the Command Line

The "SonarQube Setup Guide For .NET Users" has been created jointly with Microsoft to allow .NET users to quickly setup the SonarQube ecosystem and track technical debt with no prior knowledge.

For those already familiar with SonarQube, here are the steps required to analyze projects:

  1. Install the SonarQube Server (see Setup and Upgrade for more details)
  2. Install the SonarQube Scanner for MSBuild
  3. Install the C# Plugin, and the VB.NET plugin if you want to analyze a VB.NET project (see Installing a Plugin for more details)
  4. On the machine where you are going to run the analysis, you have to install the Microsoft .NET Framework v4.5.2+ 
  5. Open a Developer Command Prompt for Visual Studio 2013 or higher
  6. Put yourself in the root folder of the project you want to analyze (a sample project, available on GitHub, can be browsed or downloadedprojects\languages\vbnet)
  7. Run the following commands:

    1. MSBuild.SonarQube.Runner.exe begin /k:"sonarqube_project_key" /n:"sonarqube_project_name" /v:"sonarqube_project_version"
    2. Build the project, for example:
      msbuild /t:Rebuild
    3. MSBuild.SonarQube.Runner.exe end
  8. Follow the link provided at the end of the analysis to browse your project's quality in SonarQube UI (see: Browsing SonarQube)

Steps to Analyze a Project from Team Foundation Server - VSO

SonarQube Scanner is compatible with TFS 2013, 2015 and VSO

Detailed instructions to analyze .NET projects from Team Foundation Server can be found in the "SonarQube Setup Guide For .NET Users".

Steps to Analyze a Project from Jenkins

Detailed instruction to analyze .NET project from Jenkins can be found in Installing and Configuring SonarQube Scanner for Jenkins.

Configuration

See SonarQube Scanner for MSBuild Configuration to have more details about how to configure SonarQube Scanner for MSBuild.

  • No labels