Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions docs/core/testing/unit-testing-with-dotnet-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,14 @@ Due to these issues, .NET has introduced a new `dotnet test` mode specifically d

To address the issues encountered when running `dotnet test` with MTP in VSTest mode, .NET introduced a new mode in the .NET 10 SDK that's specifically designed for MTP.

To enable this mode, add a `dotnet.config` file to the root of the repository or solution.

```ini
[dotnet.test.runner]
name = "Microsoft.Testing.Platform"
To enable this mode, add the following configuration to your `global.json` file:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other PR is merged.

One small question. Should we actually briefly mention that during early previews and RC1 this was using dotnet.config, which we dropped in favor of global.json in RC2?

I want to avoid confusion when people are trying to use RC1 (because RC2 isn't released yet).

@gewarren Is there generally some policy docs follow when there is a breaking change between RC1 and RC2 when RC2 isn't yet released?

Copy link
Contributor

@gewarren gewarren Sep 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We often publish preview to preview breaking changes and then just delete the breaking change article at GA. But if this change is in RC 2, I think we should wait to publish this until RC 2 ships.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. We can wait until RC2 ships then.


```json
{
"test": {
"runner": "Microsoft.Testing.Platform"
}
}
```

> [!IMPORTANT]
Expand Down Expand Up @@ -123,7 +126,7 @@ Since this mode is specifically designed for Microsoft.Testing.Platform, neither

For users of MTP that are using the VSTest mode of `dotnet test`, there are few actions needed to migrate to the newer `dotnet test` experience:

1. Add `dotnet.config` in the root of your repository, as shown above.
1. Add `test` section to your `global.json` file, as shown above.
1. Remove `TestingPlatformDotnetTestSupport` MSBuild property, as it's no longer required.
1. Remove `TestingPlatformCaptureOutput` and `TestingPlatformShowTestsFailure` MSBuild properties, as they are no longer used by the new `dotnet test`.
1. Remove the extra `--`, for example `dotnet test -- --report-trx` should become `dotnet test --report-trx`.
Expand Down
24 changes: 15 additions & 9 deletions docs/core/tools/dotnet-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,24 @@ ms.date: 03/27/2024

## Description

The `dotnet test` command builds the solution and runs the tests with either VSTest or Microsoft Testing Platform (MTP). To enable MTP, you need to add a config file named `dotnet.config` with an INI-like format located at the root of the solution or repository.
The `dotnet test` command builds the solution and runs the tests with either VSTest or Microsoft Testing Platform (MTP). To enable MTP, you need to specify the test runner in the `global.json` file.

Some examples of the `dotnet.config` file:
Some examples of how to specify the test runner in the [`global.json`](global-json.md) file:

```ini
[dotnet.test.runner]
name = "Microsoft.Testing.Platform"
```json
{
"test": {
"runner": "Microsoft.Testing.Platform"
}
}
```

```ini
[dotnet.test.runner]
name = "VSTest"
```json
{
"test": {
"runner": "VSTest"
}
}
```

> [!IMPORTANT]
Expand Down Expand Up @@ -448,7 +454,7 @@ dotnet test -h|--help
With Microsoft Testing Platform, `dotnet test` operates faster than with VSTest. The test-related arguments are no longer fixed, as they are tied to the registered extensions in the test project(s). Moreover, MTP supports a globbing filter when running tests. For more information, see [Microsoft.Testing.Platform](../testing/microsoft-testing-platform-intro.md).

> [!WARNING]
> When Microsoft.Testing.Platform is opted in via `dotnet.config`, `dotnet test` expects all test projects to use Microsoft.Testing.Platform. It is an error if any of the test projects use VSTest.
> When Microsoft.Testing.Platform is opted in via `global.json`, `dotnet test` expects all test projects to use Microsoft.Testing.Platform. It is an error if any of the test projects use VSTest.
#### Implicit restore

Expand Down
23 changes: 23 additions & 0 deletions docs/core/tools/global-json.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,19 @@ Type: `object`

Lets you control the project SDK version in one place rather than in each individual project. For more information, see [How project SDKs are resolved](/visualstudio/msbuild/how-to-use-project-sdk#how-project-sdks-are-resolved).

### `test`

- Type: `object`

Specifies information about tests.

### `runner`

- Type: `string`
- Available since: .NET 10.0 SDK.

The test runner to discover/run tests with.

### Comments in global.json

Comments in *global.json* files are supported using JavaScript or C# style comments. For example:
Expand Down Expand Up @@ -195,6 +208,16 @@ The following example shows how to specify additional SDK search paths and a cus
}
```

The following example shows how to specify `Microsoft.Testing.Platform` as the test runner:

```json
{
"test": {
"runner": "Microsoft.Testing.Platform"
}
}
```

## global.json and the .NET CLI

To set an SDK version in the *global.json* file, it's helpful to know which SDK versions are installed on your machine. For information on how to do that, see [How to check that .NET is already installed](../install/how-to-detect-installed-versions.md#check-sdk-versions).
Expand Down
11 changes: 7 additions & 4 deletions docs/core/whats-new/dotnet-10/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,14 @@ A new `<ContainerImageFormat>` property allows you to explicitly set the format

## Support for Microsoft Testing Platform in `dotnet test`

Starting in .NET 10, `dotnet test` natively supports [Microsoft.Testing.Platform](../../testing/microsoft-testing-platform-intro.md). To enable this feature, add the following configuration to your *dotnet.config* file:
Starting in .NET 10, `dotnet test` natively supports [Microsoft.Testing.Platform](../../testing/microsoft-testing-platform-intro.md). To enable this feature, add the following configuration to your *global.json* file:

```ini
[dotnet.test.runner]
name = "Microsoft.Testing.Platform"
```json
{
"test": {
"runner": "Microsoft.Testing.Platform"
}
}
```

For more details, see [Testing with `dotnet test`](../../testing/unit-testing-with-dotnet-test.md).