Repository navigation
Description
Describe the bug
We investigated building a somewhat dynamic pipeline for a mono-repo, to keep PR-pipeline times short.
Until the 'affected-test' solution is implemented though, we thought a combination of pre-generated yaml + pipeline self-checks would work.
however using the project name for --publish-azdo-run-name breaks the call.
Steps to reproduce
make a MsTest + MTP solution/project with global.json and all
{
"test": {
"runner": "Microsoft.Testing.Platform"
}
}<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<EnableMSTestRunner>true</EnableMSTestRunner>
<OutputType>Exe</OutputType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MSTest" Version="4.4.0" />
<PackageReference Include="Microsoft.Testing.Extensions.Retry" Version="2.4.0" />
<PackageReference Include="Microsoft.Testing.Extensions.AzureDevOpsReport" Version="2.4.0" />
</ItemGroup>
<ItemGroup>
<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
</ItemGroup>
</Project>
cd $dir/TestProject2
dotnet test --project TestProject2.csproj --no-build -- --report-azdo --publish-azdo-test-results --publish-azdo-run-name TestProject2.csproj --retry-failed-tests 3Expected behavior
Tests run, and a TestRun named "TestProject2.csproj" gets created in the AZDO "Test" tab.
Actual behavior
fatal error and exit
Specifying a project for 'dotnet test' should be via '--project'.Is this a regression?
i don't know. We've only been recently able to use Microsoft.Testing.Extensions.AzureDevOpsReport due to a bug, and our pipelines having been vstest based up until now
Are there any workarounds?
avoid ".sln" / ".csproj" in the --publish-azdo-run-name parameter
dotnet --info output
.NET SDK:
Version: 10.0.401
Commit: e34a38d2ae
Workload version: 10.0.400-manifests.a3b2712e
MSBuild version: 18.9.11+e34a38d2a
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.401\
.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.12
Architecture: x64
Commit: 95017c711e
.NET SDKs installed:
7.0.102 [C:\Program Files\dotnet\sdk]
8.0.425 [C:\Program Files\dotnet\sdk]
9.0.205 [C:\Program Files\dotnet\sdk]
10.0.401 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 7.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.31 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 7.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.31 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 7.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.31 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 10.0.12 [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:
DOTNET_CLI_TELEMETRY_OPTOUT [true]
DOTNET_UPGRADEASSISTANT_TELEMETRY_OPTOUT [1]
global.json file:
C:\Users\luge\source\repos\ClassLibrary1\global.json
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/downloadIDE version
No response
Other details
Also, the documentation specifically states, that one should use a literal standalone -- to avoid ambiguity in parsing the command line. This seems contrary to what is happening:
https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-test-mtp#forward-arguments-to-the-test-application
Activity
github-actions commentedon Sep 17, 2026
🎯 Agentic Issue Triage
Thanks for the detailed repro! The
dotnet testargument parser appears to treat any value containing.csproj/.slnpassed to--publish-azdo-run-name(after--) as an implicit--projectspecifier, causing a false conflict error.Triage Assessment:
@dotnet/dotnet-testingmedium- Area is clearly dotnet test/MTP argument parsing, but the owning team could not be expanded from the snapshot.➡️ Summary:
dotnet testmisparses forwarded MTP arguments like--publish-azdo-run-namewhen their value contains.csproj/.sln, triggering a false "specify project via --project" error. Please investigate the argument-forwarding/parsing logic for values resembling project file paths.Youssef1313 commentedon Sep 21, 2026
@LukasGelke Does setting
DOTNET_TEST_DISABLE_SWITCH_VALIDATIONenv variable to1fix that for you?We can potentially relax the error so that it's not produced when
--projectis already present. (there is also a similar path for sln I believe)Evangelink commentedon Sep 21, 2026
I confirm there is a bug for net10. It's fixed for net11 and main.