Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
10 changes: 7 additions & 3 deletions docs/core/testing/microsoft-testing-platform-run-and-debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Run and debug tests with Microsoft.Testing.Platform (MTP)
description: Learn how to run and debug MTP test projects from CLI, Visual Studio, Visual Studio Code, and CI pipelines.
author: Evangelink
ms.author: amauryleve
ms.date: 06/16/2026
ms.date: 09/12/2026
ai-usage: ai-assisted
---

Expand Down Expand Up @@ -73,12 +73,14 @@ For more information on `dotnet exec`, see [dotnet exec](../tools/dotnet.md#opti

### Use `dotnet test`

MTP offers a compatibility layer with `vstest.console.exe` and [`dotnet test`](../tools/dotnet-test.md) ensuring you can run your tests as before while enabling new execution scenario.
Starting with the .NET 10 SDK, [`dotnet test`](../tools/dotnet-test-mtp.md) has a dedicated MTP mode. Select MTP through `global.json`, or use the `DOTNET_TEST_RUNNER` environment variable with .NET 11 Preview 6 or later. The dedicated mode supports projects, solutions, built test modules, and additional input types in newer SDK versions.

```dotnetcli
dotnet test Contoso.MyTests.dll
dotnet test --test-modules Contoso.MyTests.dll
```

For runner selection and migration from the VSTest-compatible mode, see [Testing with `dotnet test`](./unit-testing-with-dotnet-test.md).

## [Visual Studio](#tab/visual-studio)

The MTP tests can be run (and debugged) in Visual Studio, they integrate with Test Explorer, and can also be run directly as startup project.
Expand Down Expand Up @@ -189,3 +191,5 @@ To run a test, navigate to **Test Explorer**, select the test (or tests) to run.
- [MTP overview](./microsoft-testing-platform-intro.md)
- [MTP CLI options reference](./microsoft-testing-platform-cli-options.md)
- [Testing with `dotnet test`](./unit-testing-with-dotnet-test.md)
- [`dotnet test` with MTP](../tools/dotnet-test-mtp.md)
- [Run tests with MSTest](./unit-testing-mstest-running-tests.md)
7 changes: 6 additions & 1 deletion docs/core/testing/unit-testing-mstest-running-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Run tests with MSTest
description: Learn about how to run MSTest tests using VSTest or Microsoft.Testing.Platform (MTP).
author: Evangelink
ms.author: amauryleve
ms.date: 08/06/2026
ms.date: 09/12/2026
ai-usage: ai-assisted
---

Expand All @@ -22,6 +22,8 @@ MSTest supports running tests with both VSTest and [Microsoft.Testing.Platform (

The MSTest runner is open source and builds on the [MTP](./microsoft-testing-platform-intro.md) library. You can find `Microsoft.Testing.Platform` code in the [microsoft/testfx](https://github.com/microsoft/testfx/tree/main/src/Platform/Microsoft.Testing.Platform) GitHub repository. The MSTest runner comes bundled with `MSTest in 3.2.0` or newer.

With the .NET 10 SDK and later versions, select the dedicated MTP mode of `dotnet test` in `global.json`. Starting with .NET 11 Preview 6, you can override that selection for the current process with the `DOTNET_TEST_RUNNER` environment variable. For the supported inputs, SDK-version requirements, and MTP-specific options, see [`dotnet test` with MTP](../tools/dotnet-test-mtp.md).

## Enable MTP in an MSTest project

Use [MSTest SDK](./unit-testing-mstest-sdk.md) to greatly simplify your project configuration, version management, and alignment of MTP and its extensions.
Expand Down Expand Up @@ -152,6 +154,9 @@ Contoso.MyTests.exe --filter "FullyQualifiedName~UnitTest1|TestCategory=Category
## See also

- [Testing with `dotnet test`](unit-testing-with-dotnet-test.md)
- [`dotnet test` with MTP](../tools/dotnet-test-mtp.md)
- [`dotnet test` with VSTest](../tools/dotnet-test-vstest.md)
- [MTP CLI options reference](microsoft-testing-platform-cli-options.md)
- [Test WinUI 3 apps with MSTest and MTP](unit-testing-mstest-winui.md)
- [Filter tests](selective-unit-tests.md)
- [Order unit tests](order-unit-tests.md)
4 changes: 3 additions & 1 deletion docs/core/testing/unit-testing-with-dotnet-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Testing with 'dotnet test'
description: Learn more about how 'dotnet test' works and its support for VSTest and Microsoft.Testing.Platform (MTP)
author: Youssef1313
ms.author: ygerges
ms.date: 08/31/2026
ms.date: 09/12/2026
ai-usage: ai-assisted
---

Expand Down Expand Up @@ -129,6 +129,8 @@ To enable this mode, add the following configuration to your `global.json` file:
}
```

Starting with .NET 11 Preview 6, you can instead set the `DOTNET_TEST_RUNNER` environment variable to `Microsoft.Testing.Platform`. A recognized environment variable value overrides `global.json` for the current process. For accepted values and precedence, see [Choose a test runner](../tools/dotnet-test.md#choose-a-test-runner).

> [!IMPORTANT]
> The `dotnet test` experience for MTP is only supported in `Microsoft.Testing.Platform` version 1.7 and later.

Expand Down
Loading
Loading