Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Note for Sonar newbies

Icon
  • In order to allow Sonar to analyse your C# code base, you need to write a configuration file that gives Sonar information about your project.
  • Sonar plugins have predefined settings that you can override to meet your needs. You can do so either in the configuration file of your project or through Sonar Web application.

Create a Sonar file for your solution

Here are 2 examples of project configuration files with minimal settings, depending on which runner you will use to launch the analysis (as previously said, prefer the Simple Java Runner).

"sonar-project.properties" file for the Simple Java Runner

"pom.xml" file for Maven

File location

Icon

The Sonar configuration file should be placed at the root of your Solution. This way, Sonar will automatically discover the ".sln" file located in this folder.

Icon

If the SLN file is elsewhere, then you can add the "sonar.dotnet.visualstudio.solution.file" properties to specify its relative path.

C# plugins options

Every C# plugin defines its own options that can be overriden, may it be through the Sonar configuration file that you've just created or through Sonar "System Settings" web page. You will find below the pages that describe each C# plugin options:

  • No labels