5.6.3. Configuration

5.6.3.1. Connection to Axivion Dashboard Server

The Axivion Visual Studio Plugin accesses the analysis results through the JSON API of the Axivion Dashboard Server. Therefore, the first step after installing the plugin is to configure access to the Axivion Dashboard Server.

To access the settings, use Tools > Options > Axivion > Axivion Suite, or click the vsplugin-icon-settings icon in the Axivion Suite window.

Click Add dashboard and specify the Axivion Dashboard Server URL and the credentials used to log in to the Axivion Dashboard Server.

|vsplugin| options page.

Axivion Visual Studio Plugin options page.

Once the Axivion Dashboard Server is configured, open the Axivion Suite window ( View > Other Windows > Axivion Suite). If the dashboard configuration is correct, you should be able to select an analysis project using the leftmost combobox in the window and view the list of issues within that project. See Section Issue List for more details on the Axivion Suite window.

If the connection to the Axivion Dashboard Server fails, an error message is displayed in place of the issue list.

If the Axivion Dashboard Server supports ApiTokens, the Axivion Visual Studio Plugin uses the entered password to create an ApiToken and stores only the ApiToken instead of the password. The password or ApiToken is stored locally in the Visual Studio settings and is encrypted using the Windows Data Protection API, ensuring it can only be read by the current Windows user account.

The password is transmitted to the Axivion Dashboard Server. Use HTTPS to prevent the password from being visible during transmission over the network.

If you access the Axivion Dashboard Server over HTTPS and the server uses a self-signed certificate, you may receive the following error message:

The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
The remote certificate is invalid according to the validation procedure.

Visual Studio (and therefore the Axivion Visual Studio Plugin) uses the Windows certificate store. Installing the root certificate of the Dashboard certificate should resolve this error.

Note

If you encounter certificate or TLS connection problems and require support from Axivion, please include the following information in your support request email:

If the JAVA_HOME option is not empty, subprocesses are started with the JAVA_HOME environment variable set to the configured value. This is necessary if Java is not installed on your system but has been copied to it and the environment variable JAVA_HOME is not set globally.
Java is required for some Axivion Visual Studio Plugin features, such as displaying local build results or markers for issues found by the single-file analysis.

5.6.3.2. Path Mapping

Issues found by the Axivion Suite analysis reference files on the build machine where the analysis was performed. In contrast, the Visual Studio code editor operates on local files on the developer’s machine.

Path mapping in the Axivion Visual Studio Plugin determines the mapping between local paths and analysis projects. This allows the plugin to jump to the corresponding local file when an issue in the Axivion Suite window is double-clicked. It also works in reverse: when a local file is opened in the Visual Studio editor, the path mapping is used to identify the corresponding analysis project and file, and all issues found in the latest analysis of that file are displayed in the breakpoint margin.

The path mapping configuration is stored in the Visual Studio project files ( *.vcxproj, *.csproj, etc.) and is typically committed to source control and shared among all developers working on the project.

Alternatively, the path mapping configuration can be stored in the “Global configuration” ( %USERPROFILE%\.bauhaus\launcher.config).

Configuration of the Path Mapping

To configure the path mapping, click the vsplugin-icon-pathmap Path Mapping icon in the toolbar of the Axivion Suite window. When an issue is opened for which no mapping is configured, the Axivion Visual Studio Plugin prompts you for the corresponding local file and then automatically creates a new path mapping entry based on your selection.

:guielement:`Path Mapping` window.

Path Mapping window.

The window shows a list of all mapping entries stored in the currently opened Visual Studio projects. An entry consists of four components:

  • Store in – the Visual Studio project in which the mapping entry is stored.

  • Analysis Project – the analysis project.

  • Analysis Path – a relative path describing a directory within the analysis project (relative to the base path of the analysis project).
    Usually, this field is left empty, meaning the mapping entry refers to the base path of the analysis project.
  • Local Path – the local path that corresponds to the specified analysis path. While the Path Mapping window displays an absolute path for this field, it is stored on disk as a path relative to the Visual Studio project file. This allows the path mapping configuration to be committed to source control, so that it can be shared among developers.

To create a new entry, fill in the details and click Add. To modify an entry, select it, change its details, and click Update. To delete an entry, select it and click the vsplugin-icon-delete Delete icon to the right of the list.

Changes take effect immediately after clicking Add or Update. However, changes are not saved to disk immediately; as with other changes to the Visual Studio project file, you must use File > Save All to save the .vcxproj file.

Example Configuration

Consider the configuration for an example project with the following directory structure:

C:\project\axivion\ci_config.json
C:\project\library1\library1.vcxproj
C:\project\library1\src\...
C:\project\library2\library2.vcxproj
C:\project\library2\src\...

In the ci_config.json file, the /Project/directory option is set to ... This means C:\project is the base path for the analysis project.

For the following configuration example, assume that developers using Visual Studio have the project checked out to the local path C:\dev\project. The easiest way to configure the path mappings in this case is to use a single entry:

Store in: library1
Analysis Project: project
Analysis Path: <empty>
Local path: C:\dev\project

Because the Analysis Path field was left empty, the mapping entry applies to the whole analysis project. Thus, this entry maps the basepath C:\project on the machine running the analysis to the local path C:\dev\project on the developer’s machine.

The Axivion Visual Studio Plugin can use a mapping entry as long as at least one project containing the entry is loaded in Visual Studio. This means the entry is active for both library1 and library2, even though it is stored only in library1.vcxproj. Duplicate entries are harmless, so you can also store the same mapping entry in library2.vcxproj. This may be helpful if developers sometimes work with only library2 loaded in Visual Studio.

Alternatively, you can restrict the mapping entries to subdirectories of the analysis project by setting the Analysis Path field:

Store in: library1
Analysis Project: project
Analysis Path: library1
Local path: C:\dev\project\library1

Store in: library2
Analysis Project: project
Analysis Path: library2
Local path: C:\dev\project\library2

The first entry maps C:\project\library1 on the analysis machine to C:\dev\project\library1 on the developer’s machine. The second entry does the same for library2.

These more specific mapping entries remain usable when developers check out only one of the libraries from source control, and thus do not have the entire C:\dev\project directory on their local machine.

Note: If you have multiple analysis projects that all require the same path mappings, you can use glob patterns when configuring the analysis project name.