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)
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.
Up to 4.0
2.0, 3.5 and 4.0
3 and 4
Tested with VS2008 and VS 2010 ".sln" files.
Older versions may be also supported (feel free to give feedback)
Install the C# plugins
- Download the ZIP that contains the latest version of the C# plugins
- 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.
Install required if plugin selected?
Web site / download / install guide
Versions supported (tested in bold)
NO, StyleCop 4.4 binaries embedded in the plugin
NO, Gendarme 2.10 binaries embedded in the plugin
3.1 Update 2 + (3.2.3)
YES if you want to use PartCover as the coverage engine
2.2, 2.3 and 4.0 (4.0)
YES if you want to use NCover as the coverage engine
YES if you want to use OpenCover as the coverage engine
1.0.X, 2.0.X (2.0.8)
These tools need the .net framework installed. FxCop10 needs .net4 but the other ones will run fine with .net3.5. StyleCop plugin relies on MsBuild to run the analysis.
Check the prerequisites
- Sonar must be correctly installed
- Maven or the Sonar Java Runner must be installed
- Prefer the Java Runner: check how to install it
- Your .NET solution must be compiled if you want to use the following plugins: