Afternoon,
Confirming this on my side, with some extra detail that might save you some digging.
Environment
- NCrunch 5.20.0.2 (nCrunch.Module.XUnit3.dll, file version 5.20.0.2), VS 2026 Enterprise, Windows 11
- Test project targets net10.0
- xunit.v3 4.0.0, xunit.runner.visualstudio 4.0.0, Microsoft.NET.Test.Sdk 18.9.0
- Same NotSupportedException as the original post, on every test in the assembly
Which assembly is involved
The type NCrunch reflects into lives in xunit.v3.runner.utility.netcore.dll. That file is placed in the test project's output directory by xunit's own MSBuild targets - buildTransitive/xunit.v3.core.mtp-v2.targets in the xunit.v3.core.mtp-v2 package contains a target named _XunitCopyRunnerDependencies whose comment reads "Copy dependencies used by dynamic linked runners like NCrunch". So this copy is deliberate and aimed at you; it just now delivers a 4.0.0.0 assembly.
Confirmed in my output folder:
xunit.v3.runner.utility.netcore.dll 4.0.0.0
xunit.v3.runner.common.dll 4.0.0.0
xunit.v3.mtp-v2.dll 4.0.0.0
The exact API change
Comparing the shipped XML docs for xunit.v3.runner.common between versions:
3.2.2 exposes only:
Xunit.FrontControllerRunSettings.#ctor(ITestFrameworkExecutionOptions, IReadOnlyCollection<string>)
4.0.0 keeps that ctor (it now throws NotSupportedException at runtime) and adds three static factories:
FrontControllerRunSettings.WithSerializedTestCases(ITestFrameworkExecutionOptions, IReadOnlyCollection<string>)
FrontControllerRunSettings.WithTestCaseIDs(ITestFrameworkExecutionOptions, IReadOnlyCollection<string>)
FrontControllerRunSettings.WithSerializedTestCasesAndTestCaseIDs(ITestFrameworkExecutionOptions, IReadOnlyCollection<string>, IReadOnlyCollection<string>)
The old single-collection argument is now ambiguous between serialized test cases and test case IDs, which is presumably why the ctor had to go rather than being kept as an overload. That likely makes this more than a one-line swap in XUnit3FrameworkRuntimeEnvironment.RunTests - the adapter has to decide which of the two collections it is supplying.
The 4.0.0 release notes list other breaking changes for runner authors that may bite in the same pass:
OutOfProcessTestProcessLauncherBase.StartTestProcess gained a required shutdownProcessWaitSeconds parameter, and ProjectAssemblyRunner.Run gained resultWriters and testContextInitializedCallback.
https://xunit.net/releases/v3/4.0.0
Scope - this is NCrunch-only
This is the result of our reproduction:
- Restore and build succeed on 4.0.0, no source changes needed
- dotnet test passes the full suite
- The VSTest adapter (xunit.runner.visualstudio 4.0.0) is fine
- Only NCrunch's execution path fails, and it fails 100% of tests
One more thing that may matter for the fix: xunit.v3 3.2.2 depends on xunit.v3.mtp-v1, while 4.0.0 depends on xunit.v3.mtp-v2 (Microsoft.Testing.Platform 2.3.3 vs 1.9.1). xUnit dropped MTP v1 support entirely in 4.0, so the adapter may need to account for the platform change as well as the ctor.
Workaround
Pinning back to xunit.v3 3.2.2 + xunit.runner.visualstudio 3.1.5 restores normal NCrunch operation.
Verified that this puts xunit.v3.runner.utility.netcore.dll back to 3.2.2.0 in the output folder.
Clear bin/obj first - the mtp-v1/mtp-v2 switch regenerates the auto-generated entry point and self-registered extensions, so an incremental build is not enough.
Question for Remco Dev Team: 5.22 shipped 2026-07-22 and xunit.v3 4.0.0 released 2026-08-14, so I assume no current release handles this - can you confirm 5.22 is also affected, and whether a fix is likely in a patch or the next minor?