Configuring Roslyn

It is possible to incorporate Roslyn results in the TICS output for C# files. Roslyn also known as the .NET Compiler Platform. It provides some code analysis APIs in which the TICS C# Coding Standard has been implemented.

Prerequisites

For a successful Roslyn integration, the following prerequisites must be met.

Basic configuration

The Roslyn analyzer requires the BUILDTYPE to be properly set.

A standard Roslyn rule configuration is available in the form of a IMPL.txt, RULES.txt pair.

Optional configuration

The configuration for Roslyn can be added to either the SERVER.txt to apply them for all projects, or in PROJECTS.txt to enable project-specific settings. If the properties are declared in the SERVER file and also in the PROJECT file, the project-specific properties will override the global properties.

Syntax
'TOOLS' => {
  'Roslyn' => {
    'SLNANALYSIS' => '0|1', # default: 1
  }
}

By default, Roslyn operates on the full Visual Studio solution (to get the best possible results). However, in some cases where a solution is very large containing a lot of projects and files, Roslyn may get less responsive. In those situations one can configure Roslyn to not use the solution-based analysis but instead use file-based analysis (less accurate results but faster).

'TOOLS' => {
  'Roslyn' => {
    'SLNANALYSIS' => '0',
  }
}