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 17 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# Dependency : the plugin launches a dependency parser tool, built on Mono Cecil, to get dependency data between assemblies and classes. 
Icon

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.

Requirements

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

      Silverlight

      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.

Tool

Install required if plugin selected?

Web site / download / install guide

Versions supported (tested in bold)

FxCop

YES

http://www.infoq.com/news/2010/06/FXCop-10

1.36+ (10.0)

StyleCop

NO, StyleCop 4.4 binaries embedded in the plugin

http://archive.msdn.microsoft.com/sourceanalysis

4.3+ (4.4)

Gendarme

NO, Gendarme 2.10 binaries embedded in the plugin

http://www.mono-project.com/Gendarme

2.10+ (2.10)

Gallio

YES

http://www.gallio.org

3.1 Update 2 + (3.2.3)

PartCover

YES if you want to use PartCover as the coverage engine.
Since PartCover is no longer maintained, OpenCover is preferred.

https://github.com/sawilde/partcover.net4
(click on the "Downloads" button)

2.2, 2.3 and 4.0 (4.0)

NCover

YES if you want to use NCover as the coverage engine

http://www.ncover.com

3.0 (3.0)

OpenCover

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

https://github.com/sawilde/opencover

1.0.X, 2.0.X (2.0.8)

DependencyParserNO, binaries embedded in the pluginhttps://github.com/grozeille/DependencyParser 

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.

Icon

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 Java Runner must be installed
  • Your .NET solution must be compiled if you want to use the following plugins:
    • FxCop
    • Gendarme
    • Gallio
    • Dependency
  • No labels