Skip to content

dotnet test opaquely fails with Zero tests ran in MTP mode when --nologo is used #55309

Closed

Description

@matt-edmondson

Describe the bug

When dotnet test runs in Microsoft.Testing.Platform mode (.NET 10 SDK, global.json with "test": { "runner": "Microsoft.Testing.Platform" }), passing --nologo fails the entire run. --nologo is only defined for the VSTest flavor of the test command, so in MTP mode it parses as an unmatched token and is forwarded verbatim to every test application. The platform does not recognize --nologo (its equivalent option is --no-banner), so each module exits with code 5 (InvalidCommandLine) before discovering any tests. The user sees only a "Zero tests ran" summary with no explanation.

Steps to reproduce

  1. Create an MTP-enabled test project (for example MSTest.Sdk) with at least one passing test.

  2. Select the MTP runner in global.json:

    {
      "test": {
        "runner": "Microsoft.Testing.Platform"
      }
    }
  3. Run dotnet test. All tests pass.

  4. Run dotnet test --nologo:

    Test run summary: Zero tests ran
      error: 1
    
      total: 0
      failed: 0
      succeeded: 0
      skipped: 0
      duration: 155ms
    Test run completed with non-success exit code: 5 (see: https://aka.ms/testingplatform/exitcodes)
    

No error message identifies --nologo as the cause at any verbosity. --verbosity diagnostic does not help because in MTP mode --verbosity applies only to the MSBuild build step.

Expected behavior

Define --nologo on the MTP flavor of the test command and forward it to each test application as --no-banner. This preserves user intent (suppress banner output), keeps dotnet test command lines portable between VSTest mode and MTP mode, and removes a class of CI breakage during migration. Accepting the existing --no-banner spelling as-is would continue to work unchanged, with --nologo acting as an alias at the dotnet test layer.

If mapping to --no-banner is not acceptable, the fallback should follow the precedent of PR #54434 (which stopped forwarding MSBuild terminal-logger arguments to the test host after #52114 and #52229): exclude --nologo from unmatched-token forwarding and emit a warning that it is ignored in MTP mode. Silent forwarding of a documented dotnet test option into a hard failure should not remain the behavior in either case.

Actual behavior

  • --nologo is defined only on the VSTest command flavor (src/Cli/Microsoft.DotNet.Cli.Definitions/Commands/Test/TestCommandDefinition.VSTest.cs, created with CommonOptions.CreateNoLogoOption(forwardAs: "--property:VSTestNoLogo=true", ...)). The MTP flavor in TestCommandDefinition.MicrosoftTestingPlatform.cs does not define it.
  • The shared base (TestCommandDefinition.cs) sets TreatUnmatchedTokensAsErrors = false so that framework and extension options pass through to test applications. --nologo therefore flows into parseResult.UnmatchedTokens, is collected into the test application arguments in src/Cli/dotnet/Commands/Test/MTP/MSBuildUtility.cs (GetBuildOptions), and is passed to every module.
  • Microsoft.Testing.Platform's built-in option set (PlatformCommandLineProvider.cs in microsoft/testfx) has no nologo option. The banner suppression option is no-banner. Argument validation fails and the application exits with ExitCode.InvalidCommandLine = 5 before the dotnet test handshake completes, so no diagnostic output is surfaced.

Is this a regression?

CI test invocations that previously succeeded when supplying the --nologo flag no longer function, and do not surface the reason after migrating to MTP.

Are there any workarounds?

Removing the --nologo flag from the test invocation works but is an inconsistency across the other dotnet CLI invocations and breaking API change.

Example:

      - pwsh: dotnet restore --nologo --verbosity normal --runtime $(RUNTIME)
        displayName: Restore

      - pwsh: dotnet build --nologo --verbosity normal --no-restore --no-incremental --configuration $(CONFIG) --runtime $(RUNTIME)
        displayName: Build
      
      - pwsh: dotnet test --nologo --verbosity normal --no-build --configuration $(CONFIG)
        displayName: Test

      - pwsh: dotnet publish $(REPO)/$(REPO).csproj --nologo --verbosity normal --no-build --configuration $(CONFIG) --runtime $(RUNTIME) --framework $(FRAMEWORK) --output $(PUBLISH_PATH)
        displayName: Publish

dotnet --info output

❯ dotnet --info
.NET SDK:
 Version:           10.0.302
 Commit:            35b593bebf
 Workload version:  10.0.300-manifests.714b12c0
 MSBuild version:   18.6.11+35b593beb

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.26200
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\10.0.302\

.NET workloads installed:
There are no installed workloads to display.
Configured to use workload sets when installing new manifests.
No workload sets are installed. Run "dotnet workload restore" to install a workload set.

Host:
  Version:      10.0.10
  Architecture: x64
  Commit:       f7d90799ce

.NET SDKs installed:
  9.0.312 [C:\Program Files\dotnet\sdk]
  10.0.109 [C:\Program Files\dotnet\sdk]
  10.0.204 [C:\Program Files\dotnet\sdk]
  10.0.302 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 10.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 10.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 10.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.25 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 10.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 10.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 10.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.25 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 9.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 9.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 10.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 10.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 10.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  C:\redacted\global.json

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

IDE version

No response

Other details

This fix should go into the .NET 10 release tree, not only main:

  • .NET 10 is a Long Term Support release, supported until November 2028, and is the first SDK where the MTP mode of dotnet test exists. Teams evaluating MTP are doing so on .NET 10, and many pin CI to a 10.0.1xx feature band via global.json.
  • --nologo is common in existing scripts and CI pipelines carried over from VSTest-mode invocations. Hitting an unexplained "Zero tests ran" failure on the first migration attempt is a direct adoption blocker for MTP: the natural conclusion is that MTP is broken, and the natural response is to revert to VSTest.
  • The change is small and low risk: an option definition plus argument translation at the dotnet test layer, with no change to test execution, exit codes, or the IPC protocol.

Related

Activity

  1. added
    untriaged
    on Jul 16, 2026
  2. self-assigned this
    on Jul 17, 2026
  3. added theissue type on Jul 17, 2026
  4. removed
    untriaged
    on Jul 22, 2026
  5. DrkWzrd commented on Oct 6, 2026

    @DrkWzrd

    This is still broken (.net10), and guess what, all the agents are using models trained in a ocean of "dotnet test --nologo". This MUST be fixed

  6. silkfire commented on Oct 6, 2026

    @silkfire

    This is still broken (.net10), and guess what, all the agents are using models trained in a ocean of "dotnet test --nologo". This MUST be fixed

    The fix is in .NET 11 so you have to wait a couple of weeks more. For the agents just add a rule to use --no-banner instead

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

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions