Microsoft.Testing.Platform overview - .NET test runner - .NET (original) (raw)

Microsoft.Testing.Platform (MTP) is a lightweight and portable alternative to VSTest for running tests in all contexts, including continuous integration (CI) pipelines, CLI, Visual Studio Test Explorer, and VS Code Test Explorer. MTP is embedded directly in your test projects, and there's no other app dependencies, such as vstest.console or dotnet test needed to run your tests.

Use this article when you already decided to use MTP and you want to understand its model, capabilities, and operational behavior.

MTP is open source. You can find the Microsoft.Testing.Platform code in the microsoft/testfx GitHub repository.

Start here

Use the following path, based on what you need next:

MTP pillars

This new testing platform is built on the .NET Developer Experience Testing team's experience and aims to address the challenges encountered since the release of .NET Core in 2016. While there's a high level of compatibility between the .NET Framework and the .NET Core/.NET, some key features like the plugin-system and the new possible form factors of .NET compilations have made it complex to evolve or fully support the new runtime feature with the current VSTest platform architecture.

The main driving factors for the evolution of the new testing platform are detailed in the following:

Supported test frameworks

Supported target frameworks

MTP supports .NET (.NET 8 and later), .NET Framework (versions 4.6.2 and later), and targets NETStandard 2.0 for maximum compatibility with other runtimes.

Run and debug tests

For detailed guidance on running and debugging MTP test projects from CLI, Visual Studio, Visual Studio Code, and CI pipelines, see Run and debug tests.

Options

For the full list of platform and extension command-line options, see MTP CLI options reference.

MSBuild integration

The NuGet package Microsoft.Testing.Platform.MSBuild provides various integrations for MTP with MSBuild:

When this package is active (the default for MSTest, NUnit, and xUnit runners), installing an extension NuGet package is all that's needed — extensions are auto-registered with no code changes. If you disable the auto-generated entry point by setting <GenerateTestingPlatformEntryPoint>false</GenerateTestingPlatformEntryPoint>, you must register extensions manually in your Main method. Each extension page documents its manual registration call.

Note

This integration works in a transitive way (a project that references another project referencing this package will behave as if it references the package) and can be disabled through the IsTestingPlatformApplication MSBuild property.

See also