Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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:
- Find command-line switches in one place: MTP CLI options reference.
- Add capabilities to your test runs: use the feature pages in this article.
- Create your own extension: MTP architecture, Extension points, and Services.
Choose by scenario
- Need to customize terminal output: Terminal output (built-in)
- Need TRX or Azure DevOps reports: Test reports (extension)
- Need coverage data: Code coverage (extension)
- Need crash or hang diagnostics: Crash and hang dumps (extension)
- Need to retry failed tests: Retry (extension)
- Need hot reload support: Hot Reload (extension)
- Need Microsoft Fakes support: Microsoft Fakes (extension)
- Need OpenTelemetry traces and metrics: OpenTelemetry (extension)
- Telemetry data collection and opt-out: Telemetry (extension)
Built-in features
These features are part of the core platform and don't require additional NuGet packages.
Status and progress reporting to the terminal: output modes, ANSI support, and progress indicators.
Extension features
These features require installing NuGet packages.
Generate test report files (TRX, Azure DevOps).
Collect code coverage data during test execution.
Collect process dump files when the test host crashes or hangs.
Emit traces and metrics through OpenTelemetry during test runs.
Retry failed tests with configurable policies.
Run tests with hot reload support for rapid iteration.
Run tests that use Microsoft Fakes for stubs and shims.
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().