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

« Previous Version 29 Next »

The C# Plugins ecosystem consists of the following plugins:

  • C# Core : the core plugin that defines API used by every other plugin in the ecosystem
  • C# Squid : the plugin that parses C# code source, computes metrics and detects copy-paste (distributed by SonarSource as a freeware)
  • C# FxCop : the plugin launches FxCop analyses to detect violations relating to potential bugs, tight coupling, globalization, ...
  • C# StyleCop : the plugin launches StyleCop analyses to detect violations primarily relating to coding style (formatting, comments, ...)
  • C# Gendarme : the plugin launches Gendarme analyses to detect violations primarily relating to coding bad practices, smell detection, performance, ...
  • C# Gallio : the plugin launches Gallio to run tests and gets execution report as well as coverage report (using PartCover, OpenCover or NCover)
  • C# NDeps : the plugin launches a dependency parser tool, built on Mono Cecil, to get dependency data between assemblies and classes. 

You may not want to install of all these plugins: only the C# Core plugin is mandatory, although it won't do much without the C# Squid plugin. So let's say you need to install at least those 2 plugins.
For the other ones, feel free to install the ones that suit your need.


Below are the requirements to be able to use the C# Plugins:

  • Sonar requirements: please first check that you know the requirements for the Sonar platform itself
  • C# Plugins Ecosystem requirements
    • Your C# code base must be developped with Visual Studio, and thus must contain a ".sln" file (.NET Solution)
    • If you want test metrics, unit tests must be isolated from the main code base in dedicated Visual Studio Projects. Also the test framework must be compatible with Gallio.
    • Supported versions:

      C# language

      Up to 4.0

      .NET framework

      2.0, 3.5 and 4.0


      3 and 4

      Visual Studio

      Tested with VS2008 and VS 2010 ".sln" files.
      Older versions may be also supported (feel free to give feedback)

Install the C# plugins

  1. Download the ZIP that contains the latest version of the C# plugins
  2. Copy the plugins you chose into the "/extensions/plugins" folder of Sonar

Install the required tools

Depending on which plugin you chose to install, you may need to install the corresponding tool.

If you can, we advise you to install the same versions as the one we use for testing (i.e. the one in bold in the above table).


Install required if plugin selected?

Web site / download / install guide

Versions supported (tested in bold)



1.36+ (10.0)


NO, StyleCop 4.4 binaries embedded in the plugin

4.3+ (4.4)


NO, Gendarme 2.10 binaries embedded in the plugin

2.10+ (2.10)



3.1 Update 2 + (3.2.3)


YES if you want to use PartCover as the coverage engine.
Since PartCover is no longer maintained, OpenCover is preferred.
(click on the "Downloads" button)

2.2, 2.3 and 4.0 (4.0)


YES if you want to use NCover as the coverage engine

3.0 (3.0)


YES if you want to use OpenCover as the coverage engine.
OpenCover is preferred to PartCover.
You need .NET4 installed on your build machine in order to use OpenCover

1.0.X, 2.0.X (2.0.8)

JetBrains dotCoverYES if you want to use dotCover as the coverage engine, 2.X (1.2 & 2.0)
DependencyParserNO, binaries embedded in the plugin 

These tools need the .Net framework to be installed. Some notes:

  • FxCop10 needs .Net 4 but the other ones will run fine with .Net 3.5.
  • StyleCop plugin relies on MsBuild to run the analysis.



This may sound obvious if you are already familiar with Sonar : Sonar analysis is not necessarily performed on the same machine as the one running your Sonar server. This means that you can run Sonar on a linux box and run analysis on Windows boxes. Also you need to install the tools mentioned above on each box where analysis will be performed.

Check the prerequisites

  • Sonar must be correctly installed
  • Maven or the Sonar Runner must be installed
  • Your .NET solution must be compiled if you want to use the following plugins:
    • FxCop
    • Gendarme
    • Gallio
    • NDeps
  • No labels