You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support Microsoft.Testing.Platform — mirrors upstream #1584 #19
Mirror of nuke-build/nuke#1584. Modernization — Microsoft is moving the dotnet test runner to a new platform; NUKE's ITest abstraction may need updates. Continues Matt's .NET-modernization direction.
This has become a real problem since recently. Because xUnit.v3 v4.0 pulls in the "new" MTP v2.x package, an opt-in to MTP via global.json is unavoidable.
But doing so, breaks DotNetTest() where SetProjectFile(Solution|Project) is bootstrapped like dotnet test /path/to/sln|csproj. But this cannot be handled by MTP which explicitly needs a --project or --solution argument now.
Changing the general wrapper code to emit --project cannot be the solution either, because that would break calling dotnet test for VSTest.
Ok.. a user can workaround this by omitting .SetProjectFile() and add .SetProcessArguments("--project", $"{Project.Path:d}") instead... not pretty, but working
Same for the coverlet collector .SetDataCollector("XPlat Code Coverage"): MTP cannot handle this either, so same approach with.SetProcessArguments("--coverlet")
{
"name": "MtpProjectFile",
"type": "string",
"format": "--project {value}",
"position": 1,
"help": "Specifies a path to the test project in the new MTP syntax."
},
which generates something like
/// <summary>Specifies a path to the test project in the new MTP syntax.</summary>[Argument(Format="--project {value}",Position=1)]publicstringMtpProjectFile=> Get<string>(()=>MtpProjectFile);// .../// <inheritdoc cref="DotNetTestSettings.ProjectFile"/>[Builder(Type=typeof(DotNetTestSettings),Property=nameof(DotNetTestSettings.MtpProjectFile))]publicstaticTSetMtpProjectFile<T>(thisTo,stringv)whereT:DotNetTestSettings=>o.Modify(b =>b.Set(()=>o.MtpProjectFile,v));
I am a bit lost, because I have a project migrated to fully MTP and dotnet test /path/to/csproj is working fine.. and another project using MTP doesn't.
I think I have now a whole insight what's going on.
First of all: dotnet sdk 10.0.302+ has the positional csproj again (for MTP) so --project / --solution isn't necessary anymore and works with the current dotnet wrapper Fallout ships. ☑️ That's good
The reason was for me: I haven't migrated everything to MTP, meaning I had references to Microsoft.NET.Test.Sdk (which is the VSTest adapter). I also left over the xunit.runner.visualstudio which is also in charge for keeping vstest capabilities. Removing did not break anything, because xunit.v3 v4 (aka xunit v4) brings in the MTP package which ships a runner already (also for Rider).
Final thing: switching the package coverlet.collector (vstest) to coverlet.MTP (MTP, same version) + in the Fallout DotNetTest() switch .SetDataCollector("XPlat Code Coverage") to .AddAdditionalProcessArguments("--coverlet") fixes the pipeline for our biggest solution (about 26 Projects (incl. test projects)).
Side note: To make coverlet work you have to remove several PrivateAssets handling, because the source generator is relying on those.
Activity
IT-VBFK commentedon Aug 17, 2026
This has become a real problem since recently. Because xUnit.v3 v4.0 pulls in the "new" MTP v2.x package, an opt-in to MTP via global.json is unavoidable.
But doing so, breaks
DotNetTest()whereSetProjectFile(Solution|Project)is bootstrapped likedotnet test /path/to/sln|csproj. But this cannot be handled by MTP which explicitly needs a--projector--solutionargument now.Changing the general wrapper code to emit --project cannot be the solution either, because that would break calling dotnet test for VSTest.
Ok.. a user can workaround this by omitting
.SetProjectFile()and add.SetProcessArguments("--project", $"{Project.Path:d}")instead... not pretty, but workingSame for the coverlet collector
.SetDataCollector("XPlat Code Coverage"): MTP cannot handle this either, so same approach with.SetProcessArguments("--coverlet")IT-VBFK commentedon Aug 18, 2026
@ChrisonSimtian I can try to support this.
Would this approach suffice?
{ "name": "MtpProjectFile", "type": "string", "format": "--project {value}", "position": 1, "help": "Specifies a path to the test project in the new MTP syntax." },which generates something like
But this enables the use of:
which fails when running, but I could live with that consumers know what they are doing.
IT-VBFK commentedon Aug 19, 2026
I am a bit lost, because I have a project migrated to fully MTP and
dotnet test /path/to/csprojis working fine.. and another project using MTP doesn't.Have to dig into this a bit.
IT-VBFK commentedon Aug 19, 2026
Ok.. please scratch several above comments.
I think I have now a whole insight what's going on.
First of all: dotnet sdk 10.0.302+ has the positional csproj again (for MTP) so
--project/--solutionisn't necessary anymore and works with the current dotnet wrapper Fallout ships. ☑️ That's goodThe reason was for me: I haven't migrated everything to MTP, meaning I had references to
Microsoft.NET.Test.Sdk(which is the VSTest adapter). I also left over thexunit.runner.visualstudiowhich is also in charge for keeping vstest capabilities. Removing did not break anything, because xunit.v3 v4 (aka xunit v4) brings in the MTP package which ships a runner already (also for Rider).Final thing: switching the package
coverlet.collector(vstest) tocoverlet.MTP(MTP, same version) + in the FalloutDotNetTest()switch.SetDataCollector("XPlat Code Coverage")to.AddAdditionalProcessArguments("--coverlet")fixes the pipeline for our biggest solution (about 26 Projects (incl. test projects)).Side note: To make coverlet work you have to remove several
PrivateAssetshandling, because the source generator is relying on those.aneilmac commentedon Sep 8, 2026
Would love to see this if possible. Really happy Fallout is taking on the Nuke mantle and this would be a great feature for the immediate term.
dennisdoomen commentedon Oct 10, 2026
Superseded by #674