migrate-vstest-to-mtp

Migrate .NET test projects from VSTest to Microsoft.Testing.Platform.

1|Updated May 21, 2026
One-click install
npx skills add https://github.com/1k-off/umbraco-observability-playground --skill migrate-vstest-to-mtp-1k-off
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migrate-vstest-to-mtp
Source: https://github.com/1k-off/umbraco-observability-playground/tree/main/.agents/skills/migrate-vstest-to-mtp
Command: npx skills add https://github.com/1k-off/umbraco-observability-playground --skill migrate-vstest-to-mtp-1k-off

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the friction and CI failures caused by migrating .NET tests that currently run under VSTest so they instead run correctly under Microsoft.Testing.Platform (MTP), including handling behavioral differences like exit code 8 when zero tests are discovered.

Core Features & Use Cases

  • MTP runner enablement by framework: Guides enabling the correct MTP runner settings for MSTest, NUnit, xUnit.net v2 (via YTest.MTP.XUnit2), and xUnit.net v3 (native MTP).
  • Centralized configuration via Directory.Build.props: Provides safe patterns for configuring OutputType and runner opt-ins consistently at solution/repo scope.
  • CLI argument and filter migration: Translates common VSTest options to MTP equivalents, including special handling for xUnit.net v3 filter translation.
  • CI/CD pipeline updates: Replaces VSTest task usage with dotnet test execution and updates arguments accordingly, including required separators for .NET 9 and earlier.
  • Behavioral difference guardrails: Shows how to handle MTP-specific behavior such as zero-test exit code handling and avoids unsupported mixed-mode solutions.

Quick Start

Ask to migrate your test solution at the path you provide from VSTest to Microsoft.Testing.Platform, including translating any CI dotnet test arguments and filter syntax needed for your test frameworks.

Frequently Asked Questions about migrate-vstest-to-mtp

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate .NET test projects from VSTest to Microsoft Testing Platform?

To migrate from VSTest to Microsoft Testing Platform, you enable the correct MTP runners and update solution-wide configuration via Directory.Build.props. This ensures dotnet test works consistently across MSTest, NUnit, xUnit.net v2, and xUnit.net v3.

How do I translate VSTest CLI arguments to Microsoft Testing Platform equivalents?

Translating VSTest CLI arguments to Microsoft Testing Platform equivalents requires mapping common options to MTP flags. This includes special xUnit.net v3 filter conversion to native MTP flags and applying required command-line separators for .NET 9 and earlier.

Does Microsoft Testing Platform support xUnit.net v2 and xUnit.net v3?

Yes, Microsoft Testing Platform supports xUnit.net v2 via the YTest.MTP.XUnit2 runner and xUnit.net v3 natively. The migration process enables the correct MTP runner settings based on your specific test framework to ensure consistent dotnet test execution.

Why does dotnet test return exit code 8 after migrating to Microsoft Testing Platform?

Dotnet test returns exit code 8 after migrating to Microsoft Testing Platform when zero tests are discovered. This is a behavioral difference in MTP that requires guardrails in your CI/CD pipeline to prevent false failures when no tests match the provided filters.

How do I update CI/CD pipelines for Microsoft Testing Platform migration?

Updating CI/CD pipelines for Microsoft Testing Platform migration involves replacing VSTest task usage with dotnet test execution. You must update arguments accordingly, including required separators for .NET 9 and earlier, and avoid unsupported mixed-mode solutions.

What are the limitations when migrating to Microsoft Testing Platform?

Limitations when migrating to Microsoft Testing Platform include avoiding unsupported mixed-mode solutions containing both VSTest and MTP projects. You must also handle behavioral differences like zero-test exit code 8 and apply specific CLI argument separators for .NET 9 and earlier.