Edit

Microsoft.Testing.Platform (MTP) features

MTP ships with built-in features and can be extended through NuGet packages.

When using Microsoft.Testing.Platform.MSBuild (included transitively by MSTest, NUnit, and xUnit runners), installing an extension NuGet package is all you need — extensions are automatically detected and registered, and the entry point is generated for you.

If you opt out of the auto-generated entry point by setting <GenerateTestingPlatformEntryPoint>false</GenerateTestingPlatformEntryPoint>, you must register extensions manually in your Main method. Each extension page documents the manual registration call.

Extensions that require a NuGet package are shipped with their own licensing model (some less permissive), be sure to refer to the license associated with the extensions you want to use.

Start here

Use the following path based on your goal:

Choose by scenario

Built-in features

These features are part of the core platform and don't require additional NuGet packages.

Terminal output

Status and progress reporting to the terminal: output modes, ANSI support, and progress indicators.

Extension features

These features require installing NuGet packages.

Test reports

Generate test report files (TRX, Azure DevOps).

Code coverage

Collect code coverage data during test execution.

Crash and hang dumps

Collect process dump files when the test host crashes or hangs.

OpenTelemetry

Emit traces and metrics through OpenTelemetry during test runs.

Retry

Retry failed tests with configurable policies.

Hot Reload

Run tests with hot reload support for rapid iteration.

Microsoft Fakes

Run tests that use Microsoft Fakes for stubs and shims.

Telemetry

Telemetry collection. Learn how to opt out and what data is collected.

Logging integration

Note

The Microsoft.Extensions.Logging bridge was introduced in MTP 2.3.0.

The Microsoft.Testing.Extensions.Logging package bridges Microsoft.Testing.Platform diagnostics to ILogger, so platform and extension logs flow through the same Microsoft.Extensions.Logging pipeline your application already uses.

Manual registration:

var builder = await TestApplication.CreateBuilderAsync(args);
builder.AddMicrosoftExtensionsLogging(logging => logging.AddConsole());

Experimental extensions

The following extensions are experimental. Their APIs are annotated with the TPEXP diagnostic and might change in a future release; using them requires acknowledging the experimental diagnostic. For more information, see Microsoft.Testing.Platform diagnostics.

Video recorder (experimental, introduced in MTP 2.3.0)

Records the screen during a test run. It requires ffmpeg to be available on the machine and is enabled with the --capture-video option. Register it manually with builder.AddVideoRecorderProvider().

Packaged app deployment (experimental, introduced in MTP 2.3.0)

A reference extension that uses the experimental ITestHostLauncher extension point to deploy and launch a packaged-app test host. Register it manually with builder.AddPackagedAppDeployment().