Enables the Microsoft Testing Platform runner in global.json. Use when the user wants to enable or migrate to the new .NET testing platform.
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.
Find the solution file (*.sln) in the current directory
Check for existing global.json in the solution root directory
Create or update global.json:
{
"test": {
"runner": "Microsoft.Testing.Platform"
}
}
test section while preserving all other content:
test.runner propertysdk, msbuild-sdks, and any other existing sectionsVerify JSON validity:
dotnet build
dotnet test
If build fails, report the error and ask user how to proceed
Report results:
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"
}
}