platform-detection

Detects the .NET test platform and test framework from project configuration files.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Determining whether a .NET test project uses VSTest or Microsoft.Testing.Platform (MTP), and which framework (MSTest, xUnit, NUnit, TUnit) it runs on, requires checking multiple files with version-dependent rules that are easy to get wrong. ## Core Features & Use Cases - Framework Detection: Identifies MSTest, xUnit, NUnit, or TUnit from package references and SDK declarations in .csproj, Directory.Build.props, and Directory.Packages.props. - Platform Detection: Distinguishes VSTest from Microsoft.Testing.Platform using global.json test.runner settings on .NET 10+ or MSBuild properties on .NET 8/9. - Use Case: Before running dotnet test with the correct filter syntax, an agent reads global.json and the project files to confirm the project uses MTP with xUnit v3, avoiding invalid VSTest-style CLI arguments. ## Quick Start Ask the agent to detect which test platform and framework a given .NET test project uses by inspecting its global.json and project files.

Frequently Asked Questions about platform-detection

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

FAQPage Schema
How do I detect if a .NET project uses Microsoft.Testing.Platform or VSTest?

On .NET SDK 10+, check the global.json test.runner setting, which is authoritative. On .NET 8 or 9, check the TestingPlatformDotnetTestSupport MSBuild property in the .csproj, Directory.Build.props, and Directory.Packages.props files.

How to identify which test framework a .NET project uses?

Read the .csproj and centrally managed props files for package references. MSTest indicates MSTest, xunit or xunit.v3 packages indicate xUnit, NUnit with NUnit3TestAdapter indicates NUnit, and TUnit indicates TUnit.

Does Microsoft.NET.Test.Sdk mean the project uses VSTest?

No. Some frameworks like MSTest pull in Microsoft.NET.Test.Sdk transitively even when Microsoft.Testing.Platform is enabled. Always check the MTP signals first before concluding a project uses VSTest.

Why does TestingPlatformDotnetTestSupport not enable MTP on .NET 10?

On .NET SDK 10+, the global.json test.runner setting takes precedence over TestingPlatformDotnetTestSupport. If the runner is VSTest or unset, the project uses VSTest regardless of that MSBuild property.

Can TUnit run on the VSTest platform?

No. TUnit is MTP-only, so detecting a TUnit package reference means the project uses Microsoft.Testing.Platform. This makes TUnit a definitive platform signal during detection.