|
1 | 1 | --- |
2 | | -title: Core Framework v3 3.2.0-pre.10 |
3 | | -title-version: 2025 September 15 |
4 | | -logo-title: true |
5 | | -css: release-notes.css |
| 2 | +redirect_url: 3.2.0 |
6 | 3 | --- |
7 | | - |
8 | | -Today, we're shipping one new prerelease: |
9 | | - |
10 | | -* **xUnit.net Core Framework v3 `3.2.0-pre.10`** |
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 `global.json` with .NET 10 SDK |
26 | | - |
27 | | -When unfolding the `xunit3` template, it will create or update the `global.json` file in the solution folder root. With .NET 10 SDK, the MSBuild property `TestingPlatformDotnetTestSupport` has been obsoleted in favor of expressing the runner in `global.json` to let `dotnet test` know whether you plan to use VSTest mode or MTP mode. Additionally, MTP v2 test projects (when run with .NET 10 SDK) can only be run in MTP mode; VSTest mode is no longer supported. This will include all builds of xUnit.net v3 3.2.0 or later. |
28 | | - |
29 | | -> [!NOTE] |
30 | | -> The requirement to use `global.json` with .NET 10 SDK with MTP v2 is true regardless of the target framework that your tests target (.NET 8+ or .NET Framework 4.7.2+). If you try to run `dotnet test` against an MTP v2 enabled test project from .NET 10 SDK without creating the required `global.json` configuration element first, the system will report an error, which includes a link to Microsoft documentation. |
31 | | -> |
32 | | -> We only attempt to create/update `global.json` when you target `net10.0` because our testing has shown that the template action we're relying on does not work with .NET 8 SDK. Unfortunately, templates do not know what version of the .NET SDK you're using, only the version of the framework you're _choosing to target_ so this was the next best thing we could do, to prevent issues for users who are still running the LTS SDK (.NET 8). |
33 | | -
|
34 | | -To manually create the `global.json` update, please create or update your `global.json` file to include this entry: |
35 | | - |
36 | | -```json |
37 | | -{ |
38 | | - "test": { |
39 | | - "runner": "Microsoft.Testing.Platform" |
40 | | - } |
41 | | -} |
42 | | -``` |
43 | | - |
44 | | -For more information about `global.json` and `dotnet test`, please see the [dotnet test](https://learn.microsoft.com/dotnet/core/tools/dotnet-test) documentation. |
45 | | - |
46 | | -#### Using .NET 10 SDK prior to RC2 |
47 | | - |
48 | | -As of the writing of this release note, .NET SDK RC1 ships support for `dotnet.config` rather than `global.json`, and as such the linked documentation site above talks about `dotnet.config`. This will be replaced with the `global.json` support mentioned above in .NET SDK RC2, and presumably the documentation page will also be updated when RC2 is shipped. Once this has happened, we will update this documentation page as well. |
49 | | - |
50 | | -In the meantime, users who are using versions of .NET 10 SDK prior to RC2 will need to hand-create a `dotnet.config` file in their solution folder root, with the following contents: |
51 | | - |
52 | | -```ini |
53 | | -[dotnet.test.runner] |
54 | | -name = "Microsoft.Testing.Platform" |
55 | | -``` |
56 | | - |
57 | | -You can (and should) leave the `global.json` changes in place, as they will be required when you upgrade to RC2 (and will be harmlessly ignored with RC1). |
58 | | - |
59 | | -## Release Notes |
60 | | - |
61 | | -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. |
62 | | - |
63 | | -### Core Framework |
64 | | - |
65 | | -* 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`). |
66 | | - |
67 | | -* 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 } |
68 | | - |
69 | | -* **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 } |
70 | | - |
71 | | -* **BUG:** We have fixed an issue 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. |
72 | | - |
73 | | -* **BUG:** We have fixed an issue where we could mistakenly try to create fixture instances when we know ahead of time that all tests using those fixture instances would be skipped. [xunit/xunit#3371](https://github.com/xunit/xunit/issues/3371){: .issue-link } |
74 | | - |
75 | | -### Assertion Library |
76 | | - |
77 | | -* **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 } |
78 | | - |
79 | | -### Runners |
80 | | - |
81 | | -* 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 } |
82 | | - |
83 | | -* 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 } |
84 | | - |
85 | | -* 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 } |
86 | | - |
87 | | -* **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 } |
88 | | - |
89 | | -### Runner Utility |
90 | | - |
91 | | -* 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 } |
92 | | - |
93 | | -### Microsoft Testing Platform |
94 | | - |
95 | | -* 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