Repository navigation
Description
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
-
Create an MTP-enabled test project (for example MSTest.Sdk) with at least one passing test.
-
Select the MTP runner in
global.json:{ "test": { "runner": "Microsoft.Testing.Platform" } } -
Run
dotnet test. All tests pass. -
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
--nologois defined only on the VSTest command flavor (src/Cli/Microsoft.DotNet.Cli.Definitions/Commands/Test/TestCommandDefinition.VSTest.cs, created withCommonOptions.CreateNoLogoOption(forwardAs: "--property:VSTestNoLogo=true", ...)). The MTP flavor inTestCommandDefinition.MicrosoftTestingPlatform.csdoes not define it.- The shared base (
TestCommandDefinition.cs) setsTreatUnmatchedTokensAsErrors = falseso that framework and extension options pass through to test applications.--nologotherefore flows intoparseResult.UnmatchedTokens, is collected into the test application arguments insrc/Cli/dotnet/Commands/Test/MTP/MSBuildUtility.cs(GetBuildOptions), and is passed to every module. - Microsoft.Testing.Platform's built-in option set (
PlatformCommandLineProvider.csin microsoft/testfx) has nonologooption. The banner suppression option isno-banner. Argument validation fails and the application exits withExitCode.InvalidCommandLine = 5before 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: Publishdotnet --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/downloadIDE 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 testexists. Teams evaluating MTP are doing so on .NET 10, and many pin CI to a 10.0.1xx feature band viaglobal.json. --nologois 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 testlayer, with no change to test execution, exit codes, or the IPC protocol.
Related
- precedent for excluding SDK-level arguments from test host forwarding after identical exit code 5 failures:
- improves surfacing of handshake failures like this one but is currently main-only (.NET 11 previews). (I am filing a separate issue since diagnosability and the
--nologobehavior are independent problems.)
Activity
test: migrate tests to Microsoft Testing Platform + xunit 4.0.0; retr…
test(retry): review-round-3 hardening (per-row retry probe, surface d…
💚 Fix dotnet test failing under Microsoft.Testing.Platform
docs(ci): note that mtp rejects --nologo, and does it silently (#270)
DrkWzrd commentedon Oct 6, 2026
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
silkfire commentedon Oct 6, 2026
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-bannerinstead