GitlabCodeQualityBuildLogger 1.0.8

There is a newer version of this package available.
See the version list below for details.
dotnet add package GitlabCodeQualityBuildLogger --version 1.0.8
                    
NuGet\Install-Package GitlabCodeQualityBuildLogger -Version 1.0.8
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="GitlabCodeQualityBuildLogger" Version="1.0.8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="GitlabCodeQualityBuildLogger" Version="1.0.8" />
                    
Directory.Packages.props
<PackageReference Include="GitlabCodeQualityBuildLogger" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add GitlabCodeQualityBuildLogger --version 1.0.8
                    
#r "nuget: GitlabCodeQualityBuildLogger, 1.0.8"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package GitlabCodeQualityBuildLogger@1.0.8
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=GitlabCodeQualityBuildLogger&version=1.0.8
                    
Install as a Cake Addin
#tool nuget:?package=GitlabCodeQualityBuildLogger&version=1.0.8
                    
Install as a Cake Tool

DotNet.GitlabCodeQualityBuildLogger

LICENSE GitHub Actions GitHub Release

<p align="center"> <img width="1024" src="./.github/images/banner.png"> <br /> An MSBuild logger that outputs build warnings and errors in <a href="https://docs.gitlab.com/ee/ci/testing/code_quality.html#implement-a-custom-tool">GitLab Code Quality report format</a>. </p>

Features

  • Captures build errors and warnings during dotnet build
  • Outputs JSON in GitLab Code Quality format
  • Automatic severity mapping:
    • Build errors → critical
    • CS* (compiler warnings) → major
    • CA2*/CA5* (security rules) → major
    • CA* (other code analysis) → minor
    • IDE*/SA* (style suggestions) → info
    • Other warnings → minor
  • Generates stable fingerprints for issue tracking

Requirements

  • .NET SDK 6.0 or later (for running the tool)
  • MSBuild-based project

Installation

dotnet new tool-manifest # if you don't have a tool manifest yet
dotnet tool install GitlabCodeQualityBuildLogger.Tool

Global

dotnet tool install -g GitlabCodeQualityBuildLogger.Tool

Usage

Global

dotnet build -logger:"$(dotnet tool run gitlab-code-quality-logger);gl-code-quality-report.json"

Global

dotnet build -logger:"$(gitlab-code-quality-logger);gl-code-quality-report.json"

GitLab CI Example

build:
  stage: build
  script:
    - dotnet tool restore
    - dotnet build -logger:"$(gitlab-code-quality-logger);gl-code-quality-report.json"
  artifacts:
    reports:
      codequality: gl-code-quality-report.json

Output Format

The logger produces JSON compatible with GitLab's Code Quality report format:

[
  {
    "description": "CS0168: The variable 'x' is declared but never used",
    "check_name": "CS0168",
    "fingerprint": "A1B2C3D4E5F6...",
    "severity": "major",
    "location": {
      "path": "src/MyClass.cs",
      "lines": {
        "begin": 42
      }
    }
  }
]

Motivation

GitLab's Code Quality feature provides a great way to track code issues directly in merge requests. However, there was no simple way to integrate .NET build warnings and errors into this workflow. This logger bridges that gap by converting MSBuild output into GitLab's expected format.

Contributing

I love your input! I want to make contributing to this project as easy and transparent as possible, whether it's:

  • Reporting a bug
  • Discussing the current state of the configuration
  • Submitting a fix
  • Proposing new features
  • Becoming a maintainer

To get started please read the Contribution Guidelines.

Development

Requirements

Build

dotnet build

Test

dotnet test

Project Structure

src/
├── DotNet.GitlabCodeQualityBuildLogger/       # Core logger library (netstandard2.1)
└── DotNet.GitlabCodeQualityBuildLogger.Tool/  # CLI tool wrapper (net9.0)
tests/
└── DotNet.GitlabCodeQualityBuildLogger.Tests/ # xUnit tests

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0 230 12/14/2025
1.0.9 416 11/30/2025
1.0.8 141 11/28/2025
1.0.7 134 11/28/2025