Skip to content

Commit 47c1c64

Browse files
committed
Update wording around global.json and dotnet.config
1 parent ebc7a50 commit 47c1c64

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

site/releases/v3/3.2.0-pre.10.md

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@ The version of the `xunit.v3.templates` NuGet package included in this build now
2424

2525
### Support for `global.json` with .NET 10 SDK
2626

27-
When unfolding the `xunit3` template targeting `net10.0`, 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.
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.
2828

29-
For more information about `global.json` and `dotnet test`, please see the [dotnet test](https://learn.microsoft.com/dotnet/core/tools/dotnet-test) documentation.
30-
31-
Note that the requirement to use `global.json` 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 `global.json` configuration element first, the system will report an error, which includes a link to Microsoft documentation.
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).
3233
33-
To manually creating the `global.json` update, please create or update your `global.json` file to include this entry:
34+
To manually create the `global.json` update, please create or update your `global.json` file to include this entry:
3435

3536
```json
3637
{
@@ -40,15 +41,20 @@ To manually creating the `global.json` update, please create or update your `glo
4041
}
4142
```
4243

43-
> [!NOTE]
44-
> As of the writing of this release note, .NET SDK RC1 still ships support for `dotnet.config`, and the linked documentation site above talks about `dotnet.config` rather than `global.json`. 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.
45-
>
46-
> 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:
47-
>
48-
> ```ini
49-
> [dotnet.test.runner]
50-
> name = "Microsoft.Testing.Platform"
51-
> ```
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).
5258

5359
## Release Notes
5460

0 commit comments

Comments
 (0)