Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>C# Build Output FormatterNew to Visual Studio Code? Get it now.
C# Build Output Formatter

C# Build Output Formatter

Roger Grimstad

|
2 installs
| (0) | Free
Formats dotnet build output with customizable colors, filtering, and error templates via a custom task type.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

C# Build Output Formatter

A VS Code extension that replaces the raw dotnet build terminal output with clean, colored, and fully customizable formatting — powered by a custom task type you control from tasks.json.

Features

  • Filter output — show everything, warnings + errors only, or errors only
  • Custom templates — format each error/warning line with {token} placeholders
  • ANSI colors — per-severity colors, configurable globally or per task
  • Problems panel — errors and warnings are pushed to the VS Code Problems tab in real time
  • Pass-through args — any extra dotnet build arguments are supported via extraArgs

Quick start

Add a task to your project's .vscode/tasks.json:

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "build",
      "type": "dotnet-build-formatted",
      "project": "${workspaceFolder}/MyApp.sln",
      "filter": "errorsOnly",
      "showSummary": true,
      "problemMatcher": "$msCompile",
      "presentation": {
        "reveal": "always",
        "panel": "shared",
        "clear": true,
        "showReuseMessage": false
      }
    }
  ]
}

Run it via Terminal → Run Task or bind it to a keyboard shortcut.

Task properties

Property Type Default Description
project string ${workspaceFolder} Path to .csproj, .sln, or directory
filter all | errorsOnly | warningsAndErrors all Which lines to display
errorTemplate string ❌ {file}:{line}:{column} [{code}] {message} Template for error lines
warningTemplate string ⚠ {file}:{line}:{column} [{code}] {message} Template for warning lines
infoTemplate string {message} Template for plain pass-through lines
showSummary boolean true Show a colored build succeeded/failed line at the end
verbosity quiet | minimal | normal | detailed | diagnostic minimal Passed as /verbosity:<level>
noSummary boolean true Suppresses MSBuild's own summary block
warningLevel number — Passed as /p:WarningLevel=<n>
colors object (see below) Per-task color overrides
extraArgs string[] [] Extra arguments appended to dotnet build

Template tokens

Use these inside errorTemplate, warningTemplate, and infoTemplate:

Token Value
{severity} error, warning, or info
{file} Filename only — e.g. Program.cs
{filePath} Full path as reported by MSBuild
{line} Line number
{column} Column number
{code} Diagnostic code — e.g. CS0103
{message} Diagnostic message text
{project} .csproj path from the MSBuild [...] suffix

Colors

Named colors available for all color properties:

red bright_red green bright_green yellow bright_yellow blue bright_blue magenta bright_magenta cyan bright_cyan white bright_white dim bold

Per-task override

"colors": {
  "error":   "bright_red",
  "warning": "yellow",
  "success": "bright_green",
  "failure": "bright_red",
  "info":    "dim"
}

Global defaults (VS Code settings)

// settings.json
"dotnetBuildFormatter.colors.error":   "bright_red",
"dotnetBuildFormatter.colors.warning": "yellow",
"dotnetBuildFormatter.colors.success": "bright_green",
"dotnetBuildFormatter.colors.failure": "bright_red",
"dotnetBuildFormatter.colors.info":    "dim",
"dotnetBuildFormatter.defaultFilter":  "all",
"dotnetBuildFormatter.defaultErrorTemplate":   "❌ {file}:{line}:{column}  [{code}]  {message}",
"dotnetBuildFormatter.defaultWarningTemplate": "⚠  {file}:{line}:{column}  [{code}]  {message}"

Per-task colors always override the global settings.

Using environment variables

Define a shared project path once, reference it in multiple tasks:

{
  "version": "2.0.0",
  "options": {
    "env": {
      "project_file": "Web/Web.csproj"
    }
  },
  "tasks": [
    {
      "label": "build:errors-only",
      "type": "dotnet-build-formatted",
      "project": "${env:project_file}",
      "filter": "errorsOnly"
    }
  ]
}

Note: VS Code does not automatically substitute ${env:...} tokens in CustomExecution tasks. This extension reads options.env from your tasks.json directly to bridge that gap.

Example tasks

Errors only, default colors

{
  "label": "build:errors-only",
  "type": "dotnet-build-formatted",
  "project": "${workspaceFolder}",
  "filter": "errorsOnly",
  "showSummary": true,
  "verbosity": "minimal",
  "problemMatcher": "$msCompile"
}

Custom templates with emoji

{
  "label": "build:custom",
  "type": "dotnet-build-formatted",
  "project": "${workspaceFolder}/MyApp.sln",
  "filter": "warningsAndErrors",
  "errorTemplate":   "❌ {file}:{line}:{column}  [{code}]  {message}",
  "warningTemplate": "⚠  {file}:{line}  [{code}]  {message}",
  "showSummary": true,
  "problemMatcher": "$msCompile"
}

Release build, no warnings

{
  "label": "build:release",
  "type": "dotnet-build-formatted",
  "project": "${workspaceFolder}",
  "filter": "errorsOnly",
  "warningLevel": 0,
  "extraArgs": ["--configuration", "Release", "--no-restore"],
  "problemMatcher": "$msCompile"
}

Requirements

  • .NET SDK installed and dotnet on your PATH
  • VS Code 1.85 or later
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft