mtp-hot-reload

Configures Microsoft Testing Platform hot reload to iterate on failing tests without rebuilding.

Updated Jul 12, 2026
One-click install
npx skills add https://github.com/Patrick-Rex/DotNetTechSamples --skill mtp-hot-reload-patrick-rex
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mtp-hot-reload
Source: https://github.com/Patrick-Rex/DotNetTechSamples/tree/main/.agents/plugins/dotnet-test/skills/mtp-hot-reload
Command: npx skills add https://github.com/Patrick-Rex/DotNetTechSamples --skill mtp-hot-reload-patrick-rex

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Fixing failing tests normally requires a full rebuild and test run for every code change, which slows down the fix-verify loop. This Skill sets up Microsoft Testing Platform (MTP) hot reload so the test host stays running and automatically re-runs affected tests whenever you edit code. ## Core Features & Use Cases - Platform Detection: Verifies the project uses Microsoft Testing Platform rather than VSTest, since hot reload only works with MTP. - Guided Setup: Walks through installing the Microsoft.Testing.Extensions.HotReload NuGet package and enabling the TESTINGPLATFORM_HOTRELOAD_ENABLED environment variable via shell or launchSettings.json. - Framework-Aware Filtering: Provides the correct test filter syntax for MSTest, NUnit, xUnit v3, and TUnit so you can target only the failing tests. - Use Case: You have three failing unit tests after a refactor. Instead of running dotnet test after every edit, you start the test host with hot reload, edit the production code, and watch the affected tests re-run automatically until they pass. ## Quick Start Set up MTP hot reload in my test project so I can iterate on my failing tests without rebuilding between changes.

Frequently Asked Questions about mtp-hot-reload

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

FAQPage Schema
How do I run .NET tests without rebuilding after each code change?

Use Microsoft Testing Platform hot reload by installing the Microsoft.Testing.Extensions.HotReload package, setting TESTINGPLATFORM_HOTRELOAD_ENABLED=1, and running the test project with dotnet run. The test host stays active and re-runs affected tests when you edit code.

How to set up MTP hot reload in a test project?

Add the Microsoft.Testing.Extensions.HotReload NuGet package, then set the TESTINGPLATFORM_HOTRELOAD_ENABLED environment variable to 1, either in your shell or in Properties/launchSettings.json. Run tests with dotnet run --project <path> instead of dotnet test.

Does hot reload work with VSTest or dotnet test?

No, hot reload requires Microsoft Testing Platform and does not work with VSTest or the dotnet test command. You must run the test project directly with dotnet run, or migrate from VSTest to MTP first.

Can I use MTP hot reload in Visual Studio Test Explorer?

No, MTP hot reload currently works in console mode only and has no Test Explorer integration in Visual Studio or VS Code. Visual Studio has its own separate built-in Test Explorer hot reload feature.

Why is my code change not picked up by the hot reload test host?

Some edits are unsupported rude changes, such as adding new types or changing method signatures, which require a restart. Stop the test host with Ctrl+C and run dotnet run again to apply them.

How do I filter to specific failing tests with hot reload?

Pass the filter after -- when running dotnet run. MSTest and NUnit use --filter "FullyQualifiedName~TestName", xUnit v3 uses --filter-method "*TestName", and TUnit uses --treenode-filter with a path pattern.