4.9. C# Configuration

Sonargraph includes the dependencies to external assemblies (DLLs) in its analysis. The paths where the external assemblies are located need to be defined in an "Installation Profile". The preference dialog opened via the menu "Preferences..." , allows the definition of your own profiles. The definition of assembly directories is based on Groovy Templates, allowing for flexible profiles that can be shared between team members.

Sonargraph detects the installed Microsoft .NET frameworks and offers them as installation profiles. For .NET 5 as well as .NET Core and other target frameworks, matching profiles can be generated via MsBuild. Make sure that MsBuild is configured correctly by opening the "Build Executor" preference page (see Section 4.9.1, “C# Build Executor Configuration”). On the preference page "Profiles Generation" select the frameworks for which you want to generate the installation profiles. Afterwards, you can configure one of them as the "active" installation profile, or configure them as a system profile (see Section 7.3.4, “C# Module Configuration”).

These profiles can be used as templates to generate new profiles. The activated profile is used as default profile for all new software systems that contain C# modules.

For some project types you need to specify additional assemblies to be included (e.g. Windows.winmd for XAML projects). This can be done in the lower section of the preference page as shown in the screenshot below:

C# Installation Profile Definition
Figure 4.6. C# Profiles Configuration


Modifying the content of a profile that is used by the currently opened software system will force a full reparse as soon as the profile is activated or the changes are applied.

As default, installation profiles are stored in the Sonargraph home directory. These profiles are not intended to be shared. If you want to share installation profiles across team members, it is recommended to specify a separate directory in the search path that contains these shared profiles. See Section 4.10, “Search Path Configuration” .