| name | dotnet-enable-testing-platform |
| description | Enables the Microsoft Testing Platform runner in global.json. Also use when the user mentions "testing platform," "Microsoft.Testing.Platform," "new test runner," "migrate test runner," "global.json testing," or "modern test platform." |
| license | MIT |
| metadata | {"author":"Im5tu","version":"1.0","repositoryUrl":"https://github.com/im5tu/dotnet-skills"} |
| allowed-tools | Bash(dotnet:*) Read Glob AskUserQuestion |
Enable the Microsoft Testing Platform runner for a .NET solution by configuring global.json.
The Microsoft Testing Platform is a modern, extensible test runner that provides improved performance, better diagnostics, and native support for parallel test execution.
Steps
-
Find the solution file (*.sln) in the current directory
- If no .sln found, warn and stop
-
Check for existing global.json in the solution root directory
- Read contents if file exists
-
Create or update global.json:
-
Verify JSON validity:
dotnet build
dotnet test
-
If build fails, report the error and ask user how to proceed
-
Report results:
- Confirm global.json was created or updated
- Show the final global.json content
- Confirm build status
- Confirm tests run successfully
Example global.json Configurations
Minimal (new file):
{
"test": {
"runner": "Microsoft.Testing.Platform"
}
}
Merged (existing file with SDK pinning):
{
"sdk": {
"version": "8.0.100",
"rollForward": "latestMinor"
},
"test": {
"runner": "Microsoft.Testing.Platform"
}
}
Error Handling
- If no .sln found: warn and stop
- If global.json exists but is invalid JSON: report error and ask user
- If build fails after update: show errors and ask user how to proceed