Skip to content

Feature: Add dotnet / MSBuild command filters #191

Closed

Description

@LukasMerz

Summary

Add filter support for the .NET / MSBuild toolchain, which is missing from RTK's current command coverage.

Commands to support

Command Noise to strip Est. savings
dotnet restore NuGet resolution, "Determining projects to restore", "All projects are up-to-date", per-package HTTP/CACHE lines, "Assets file has not changed" 80-90%
dotnet build Copyright banners, per-project compile lines, "Build started" progress, CSC invocations — keep only errors/warnings/summary 70-85%
MSBuild.exe (Windows) Same as dotnet build plus X> prefixed progress lines, CoreCompile:, CopyFilesToOutputDirectory:, ResolveAssemblyReferences: task output 80-90%
dotnet test "Starting test execution, please wait...", individual passing test names, NUnit/xUnit adapter banners — keep only failures + summary 90-95%
dotnet format / dotnet csharpier format Per-file output for unchanged files — keep only changed files and errors 70-80%

Why this matters

.NET is one of the most popular enterprise ecosystems and MSBuild is famously verbose. When using AI coding agents (Claude Code, Cursor, etc.) on .NET projects, build/test output easily consumes 5-15K tokens per invocation, most of which is noise the LLM doesn't need.

The pattern is the same as existing RTK filters:

  • On success: show only summary (e.g., "Build succeeded. 0 Error(s), 0 Warning(s). Time Elapsed 00:00:12.34")
  • On failure: show errors/warnings with file+line context, skip passing details
  • On test failure: show failed test names, assertion messages, and stack traces — skip passing tests

Example noisy output (MSBuild success, ~2K tokens)

Microsoft (R) Build Engine version 17.12.0 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

1>------ Build started: Project: "Core", Configuration: Debug Any CPU ------
1>CoreCompile:
1>  C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe /noconfig /nowarn:1701,1702 ...
1>CopyFilesToOutputDirectory:
1>  Copying file from "obj\Debug\Core.dll" to "bin\Debug\Core.dll"
...
(repeat for 30+ projects)
...
Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:01:23.45

Ideal filtered output (~50 tokens):

Build succeeded. 0 Warning(s), 0 Error(s). Time Elapsed 00:01:23.45

Platform notes

  • MSBuild.exe is Windows-only (typically at C:\Program Files\Microsoft Visual Studio\...\MSBuild\Current\Bin\MSBuild.exe or similar SDK paths)
  • dotnet CLI is cross-platform
  • Both support -verbosity:quiet / --verbosity quiet but even quiet mode produces significant noise that could be filtered further

Activity

  1. F0rty-Tw0 commented on Feb 18, 2026

    @F0rty-Tw0
    Contributor

    Duplicate of #103

  2. danielmarbach commented on Feb 21, 2026

    @danielmarbach
    Contributor

    I think dotnet format should be trivial to add. I'll give it a go

  3. LukasMerz commented on Feb 22, 2026

    @LukasMerz
    Author

    How about ms build? That would also be nice

  4. danielmarbach commented on Feb 22, 2026

    @danielmarbach
    Contributor

    It also has binlog support so it should be simple but the cases you need msbuild these days are fewer and fewer. I will finish the net support first and then see if I still have energy to contribute

  5. added
    enhancement
    P3-nice-to-have
    on Mar 8, 2026
  6. pszymkowiak commented on Mar 16, 2026

    @pszymkowiak
    Collaborator

    Fixed in v0.30.0 — dedicated Rust module (dotnet_cmd.rs) + dotnet-build.toml TOML filter. Tested locally: rtk dotnet build outputs compact summary. See #572 for a known TUnit flag bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3-nice-to-haveenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions