.github/skills/mtp-hot-reload/SKILL.md
Suggests using Microsoft Testing Platform (MTP) hot reload to iterate fixes on failing tests without rebuilding. Use when user says "hot reload tests", "iterate on test fix", "run tests without rebuilding", "speed up test loop", "fix test faster", or needs to set up MTP hot reload to rapidly iterate on test failures. Covers setup (NuGet package, environment variable, launchSettings.json) and the iterative workflow for fixing tests. DO NOT USE FOR: writing test code, diagnosing test failures, CI/CD pipeline configuration, or Visual Studio Test Explorer hot reload (which is a different feature).
npx skillsauth add microsoft/vstest mtp-hot-reloadInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Set up and use Microsoft Testing Platform hot reload to rapidly iterate fixes on failing tests without rebuilding between each change.
| Input | Required | Description | |-------|----------|-------------| | Test project path | No | Path to the test project (.csproj). Defaults to current directory. | | Failing test name or filter | No | Specific test(s) to iterate on |
Hot reload requires MTP. It does not work with VSTest.
Follow the detection procedure in the platform-detection skill to determine the test platform.
If the project uses VSTest, inform the user that MTP hot reload is not available and suggest migrating to MTP first (see migrate-vstest-to-mtp), or using Visual Studio's built-in Test Explorer hot reload feature instead.
Install the Microsoft.Testing.Extensions.HotReload package:
dotnet add <project-path> package Microsoft.Testing.Extensions.HotReload
Note: When using
Microsoft.Testing.Platform.MSBuild(included transitively by MSTest, NUnit, and xUnit runners), the extension is auto-registered when you install its NuGet package -- no code changes needed.
Hot reload is activated by setting the TESTINGPLATFORM_HOTRELOAD_ENABLED environment variable to 1.
Option A -- Set it in the shell before running tests:
# PowerShell
$env:TESTINGPLATFORM_HOTRELOAD_ENABLED = "1"
# bash/zsh
export TESTINGPLATFORM_HOTRELOAD_ENABLED=1
Option B -- Add it to launchSettings.json (recommended for repeatable use):
Create or update Properties/launchSettings.json in the test project:
{
"profiles": {
"<ProjectName>": {
"commandName": "Project",
"environmentVariables": {
"TESTINGPLATFORM_HOTRELOAD_ENABLED": "1"
}
}
}
}
Run the test project directly (not through dotnet test) to use hot reload in console mode:
dotnet run --project <project-path>
To filter to specific failing tests, pass the filter after --. The syntax depends on the test framework -- see the filter-syntax skill for full details. Quick examples:
| Framework | Filter syntax |
|-----------|--------------|
| MSTest | dotnet run --project <path> -- --filter "FullyQualifiedName~TestMethodName" |
| NUnit | dotnet run --project <path> -- --filter "FullyQualifiedName~TestMethodName" |
| xUnit v3 | dotnet run --project <path> -- --filter-method "*TestMethodName" |
| TUnit | dotnet run --project <path> -- --treenode-filter "/*/*/ClassName/TestMethodName" |
The test host will start, run the tests, and remain running waiting for code changes.
Important: Hot reload currently works in console mode only. There is no support for hot reload in Test Explorer for Visual Studio or Visual Studio Code.
Once all tests pass:
dotnet test to confirm all tests pass with a clean buildTESTINGPLATFORM_HOTRELOAD_ENABLED from the environment or keep launchSettings.json for future useMicrosoft.Testing.Extensions.HotReload package is installedTESTINGPLATFORM_HOTRELOAD_ENABLED environment variable is set to 1| Pitfall | Solution |
|---------|----------|
| Using dotnet test instead of dotnet run | Hot reload requires dotnet run --project <path> to run the test host directly in console mode |
| Project uses VSTest, not MTP | Hot reload requires MTP. Migrate to MTP first or use VS Test Explorer hot reload |
| Forgetting to set the environment variable | Set TESTINGPLATFORM_HOTRELOAD_ENABLED=1 before running |
| Expecting Test Explorer integration | Console mode only -- no VS/VS Code Test Explorer support |
| Making unsupported code changes (rude edits) | Some changes (adding new types, changing method signatures) require a restart. Stop and re-run |
development
Best practices for writing MSTest 3.x/4.x unit tests. Use when the user needs to write, improve, fix, or review MSTest tests, including modern assertions, data-driven tests, test lifecycle, and common anti-patterns. Also use when fixing test issues like swapped Assert.AreEqual arguments, incorrect assertion usage, or modernizing legacy test code. Covers MSTest.Sdk, sealed classes, Assert.Throws, DynamicData with ValueTuples, TestContext, and conditional execution.
development
Build, test, and validate changes in the vstest repository. Use when building vstest projects, running unit tests, smoke tests, or acceptance tests, or when deploying locally built vstest.console for manual testing.
development
Validate that commands documented in skill files actually work. Use when creating, updating, or reviewing skills to ensure all documented commands exit with code 0.
testing
Parse and analyze Visual Studio TRX test result files. Use when asked about slow tests, test durations, test frequency, flaky tests, failure analysis, or test execution patterns from TRX files.