Loading...
Loading...
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 skill4agent add dotnet/skills mtp-hot-reload| 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 |
run-testsglobal.json"test": { "runner": "Microsoft.Testing.Platform" }<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>.csprojDirectory.Build.propsDirectory.Packages.props<Sdk Name="MSTest.Sdk"><EnableMSTestRunner>true</EnableMSTestRunner>Microsoft.Testing.Extensions.HotReloaddotnet add <project-path> package Microsoft.Testing.Extensions.HotReloadNote: When using(included transitively by MSTest, NUnit, and xUnit runners), the extension is auto-registered when you install its NuGet package — no code changes needed.Microsoft.Testing.Platform.MSBuild
TESTINGPLATFORM_HOTRELOAD_ENABLED1# PowerShell
$env:TESTINGPLATFORM_HOTRELOAD_ENABLED = "1"
# bash/zsh
export TESTINGPLATFORM_HOTRELOAD_ENABLED=1launchSettings.jsonProperties/launchSettings.json{
"profiles": {
"<ProjectName>": {
"commandName": "Project",
"environmentVariables": {
"TESTINGPLATFORM_HOTRELOAD_ENABLED": "1"
}
}
}
}dotnet testdotnet run --project <project-path>--| Framework | Filter syntax |
|---|---|
| MSTest | |
| NUnit | |
| xUnit v3 | |
| TUnit | |
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.
dotnet testTESTINGPLATFORM_HOTRELOAD_ENABLEDlaunchSettings.jsonMicrosoft.Testing.Extensions.HotReloadTESTINGPLATFORM_HOTRELOAD_ENABLED1| Pitfall | Solution |
|---|---|
Using | Hot reload requires |
| 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 |
| 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 |