|
| 1 | +--- |
| 2 | +title: Core Framework v3 3.2.0-pre.5 |
| 3 | +title-version: 2025 September 5 |
| 4 | +logo-title: true |
| 5 | +css: release-notes.css |
| 6 | +--- |
| 7 | + |
| 8 | +Today, we're shipping one new prerelease: |
| 9 | + |
| 10 | +* **xUnit.net Core Framework v3 `3.2.0-pre.5`** |
| 11 | + |
| 12 | +As always, we'd like to thank all the users who contributed to the success of xUnit.net through usage, feedback, and code. 🎉 |
| 13 | + |
| 14 | +## Microsoft Testing Platform v2 |
| 15 | + |
| 16 | +This prerelease build is released for users to be able to use preview builds of Microsoft Testing Platform v2. It is anticipated that Microsoft Testing Platform v2 RTM will ship sometime around the same time as .NET 10 SDK RTM. Our plan is for xUnit.net v3 3.2.0 RTM to also ship around the same time. |
| 17 | + |
| 18 | +### Updated Templates with `net10.0` Support |
| 19 | + |
| 20 | +The version of the `xunit.v3.templates` NuGet package included in this build now supports targeting .NET 10 (`net10.0`). You can set the framework for `dotnet new` templates by passing `--framework <tfm>` to the `dotnet new` command line. |
| 21 | + |
| 22 | +* The default framework for `xunit3` will remain `net8.0` until it reaches end of life |
| 23 | +* The default framework for `xunit3-extension` will remain `netstandard2.0` indefinitely |
| 24 | + |
| 25 | +### Support for `dotnet.config` with .NET 10 SDK |
| 26 | + |
| 27 | +When unfolding the `xunit3` template targeting `net10.0`, it will create a `dotnet.config` file in the solution folder root. The `dotnet.config` file replaces (and obsoletes) the MSBuild property `TestingPlatformDotnetTestSupport` when using .NET 10 SDK, to let `dotnet test` know whether you plan to use VSTest mode or MTP mode. |
| 28 | + |
| 29 | +For more information about `dotnet.config`, please see the [dotnet test](https://learn.microsoft.com/dotnet/core/tools/dotnet-test) documentation. |
| 30 | + |
| 31 | +> [!NOTE] |
| 32 | +> The template action that this depends on has not yet shipped as of today (in .NET 10 SDK Preview 7). We anticipate that this will ship sometime before the .NET 10 SDK RTM. This new file is a requirement for Microsoft Testing Platform v2 to use the new MTP-enabled `dotnet test` when running with .NET 10 SDK, as VSTest mode will no longer be supported for MTP v2 projects when using .NET 10 SDK. |
| 33 | +> |
| 34 | +> In the meantime, users who are using preview versions of .NET 10 SDK will need to hand-create a `dotnet.config` file in their solution folder root, with the following contents: |
| 35 | +> |
| 36 | +> ```ini |
| 37 | +> [dotnet.test.runner] |
| 38 | +> name = "Microsoft.Testing.Platform" |
| 39 | +> ``` |
| 40 | +> |
| 41 | +> Note that the requirement to use `dotnet.config` with .NET 10 SDK with MTP v2 is true regardless of the target framework that your tests target. If you try to run `dotnet test` against an MTP v2 enabled test project from .NET 10 SDK without creating the required `dotnet.config` file first, the system will report an error, which includes a link to Microsoft documentation. |
| 42 | +
|
| 43 | +## Release Notes |
| 44 | +
|
| 45 | +An RTM release for 3.1.0 is currently planned within the next couple weeks, and this preview release includes features from that codebase as well. Those new features are listed below. |
| 46 | +
|
| 47 | +### Core Framework |
| 48 | +
|
| 49 | +* We have added a new `XunitSerializer<T>` class which can be used as a base class when implementing `IXunitSerializer` for one type. This adds type safety to the APIs (giving instances of `T` to `Serialize` and `IsSerializable`, and expecting an instance of `T` from `Deserialize`), as well as providing some boilerplate logic to ensure this type safety at runtime. This also includes automatic support for arrays of values, meaning that `IsSerializable` will be called repeatedly with the instances of values in the array rather than being called just once with the array itself (as is the case with `IXunitSerializer.IsSerializable`). |
| 50 | +
|
| 51 | +* We have enhanced the support for event source events produced by xUnit.net. In addition to `TestStart` and `TestStop` events, we have also added `TestAssemblyStart`, `TestAssemblyStop`, `TestCollectionStart`, `TestCollectionStop`, `TestClassStart`, `TestClassStop`, `TestMethodStart`, `TestMethodStop`, `TestCaseStart`, and `TestCaseStop`. We have also added a new `result` value to `TestStop` to indicate what the final test result was. [xunit/xunit#3386](https://github.com/xunit/xunit/issues/3386){: .issue-link } |
| 52 | +
|
| 53 | + > [!NOTE] |
| 54 | + > Known issue: the result in `TestStop` will incorrectly report `Passed` for tests which timed out. This will be fixed by the time 3.1.0 ships as RTM. |
| 55 | +
|
| 56 | +* **BUG:** We have fixed an issue where `IRunnerReporterMessageHandler.DisposeAsync` was not being called. [xunit/xunit#3385](https://github.com/xunit/xunit/issues/3385){: .issue-link } |
| 57 | +
|
| 58 | +* **BUG:** We have fixed a bug in `ConsoleRunnerInProcess` (which is primarily used by NCrunch) where we were causing an extra unnecessary discovery phase when trying to run individual tests. This should improve individual test execution performance. |
| 59 | +
|
| 60 | +### Assertion Library |
| 61 | +
|
| 62 | +* **BUG:** We have fixed an issue with `Assert.EquivalentWithExclusions` with the way that collections are handled. The expression for collections must now include `[]` at the end of a collection property/field name. For example, the expression `MyCollection[].MyProperty` will exclude `MyProperty` when comparing values inside the `MyCollection` collection. For more information, see the attached issue. [xunit/xunit#3394](https://github.com/xunit/xunit/issues/3394){: .issue-link } |
| 63 | +
|
| 64 | +### Runners |
| 65 | +
|
| 66 | +* We have updated the Azure DevOps runner reporter to use the latest versions of the APIs. [xunit/xunit#3376](https://github.com/xunit/xunit/issues/3376){: .issue-link } |
| 67 | +
|
| 68 | +* We have updated the default runner reporter to report the test assembly's unique ID in the "Finished" message displayed on-screen, rather than in the summary, due to the fact that some runners (like `dotnet test`) did not display the summary. [xunit/xunit#3365](https://github.com/xunit/xunit/issues/3365){: .issue-link } |
| 69 | +
|
| 70 | +* We have updated the `-list full` output from the in-process console runner to include the test case unique ID of each discovered test (this is available in both human-readable form as well as JSON form via `-list full/json`). We have also added a `-id` switch that allows the user to run a test case by unique ID. This complements the existing MTP command line switch (`--filter-uid`) which also allows running a test case by unique ID. [xunit/xunit#3179](https://github.com/xunit/xunit/issues/3179){: .issue-link } |
| 71 | +
|
| 72 | +* **BUG:** We have fixed the output of the JUnit report to conform to the JUnit 4 XSD. This changed the skip counter attribute name in `testsuites` from `skipped` to `disabled`, and removes the attachment, traits, and warning nodes that were previously (illegally) reported under the `testsuite`. [xunit/xunit#3393](https://github.com/xunit/xunit/issues/3393){: .issue-link } |
| 73 | +
|
| 74 | +### Runner Utility |
| 75 | +
|
| 76 | +* We have added `XunitProjectAssembly.TestCaseIDsToRun`, which allows runner authors to specify test cases they wish to run by ID. This supplements the existing `XunitProjectAssembly.TestCasesToRun`, which allows runner authors to specify test cases they wish to run by providing the serialized test case. This is used by the new `-id` console runner switch mentioned above. [xunit/xunit#3179](https://github.com/xunit/xunit/issues/3179){: .issue-link } |
| 77 | +
|
| 78 | +### Microsoft Testing Platform |
| 79 | +
|
| 80 | +* We will only pre-enumerate theory data rows by default when running in Test Explorer now. Previously we would pre-enumerate theory data rows by default when running in `dotnet test`, but we are skipping this now by default (as a performance optimization). You can as always [force pre-enumeration through configuration](/docs/config-xunit-runner-json#preEnumerateTheories). |
0 commit comments