Identifies a .NET project's test platform, framework, command mode, and project system type by resolving configuration precedence.
- GitHub stars
- 5,942
- Files
- 2
- Last commit
- Nov 11, 2026
- License
- MIT
- Allowed tools
- —
What does the platform-detection skill do?
platform-detection identifies a .NET project's test platform, framework, command mode, and project system type by resolving configuration precedence.
Summary generated from the skill's SKILL.md.
About the platform-detection skill
Developers working with .NET repositories can use this tool to accurately identify the specific testing environment of a project. It determines whether a project uses VSTest or the Microsoft Testing Platform (MTP) and identifies the underlying framework, such as MSTest, xUnit, NUnit, or TUnit. It also distinguishes between modern SDK-style projects and classic project systems by analyzing configuration files.
To provide an accurate verdict, the tool resolves configuration precedence by inspecting files like .csproj, global.json, packages.config, Directory.Build.props, and Directory.Packages.props. It follows the actual MSBuild import order to find the winning property, ensuring that later assignments or conditional imports are correctly prioritized. This prevents errors caused by assuming a property is set based solely on a single file.
This skill is intended for diagnostic purposes to answer questions about test runners and framework types. It should not be used to execute tests, filter test results, or generate command-line flags. For actual test execution, developers should use the run-tests tool instead.
What an agent can do with it
- 1Identify the active test frameworkDetermine if a project is configured to use MSTest, xUnit, NUnit, or TUnit.
- 2Classify the project system typeCheck whether a .NET project uses the modern SDK-style format or the classic project system.
- 3Resolve configuration conflictsExplain why a specific test runner was selected when multiple configuration files provide different settings.
Written from the skill's SKILL.md. Every use case is checked against a quote from it.
How to install the platform-detection skill
Each command copies the skill folder into the client's skills directory. Restart the client or start a new session to load it.Install the platform-detection skill in Plugin
/plugin marketplace add dotnet/skills /plugin install dotnet-test@dotnet-agent-skills
Install the platform-detection skill in Claude Code
~/.claude/skills/platform-detection/SKILL.md
$ npx degit dotnet/skills/plugins/dotnet-test/skills/platform-detection ~/.claude/skills/platform-detectionInstall the platform-detection skill in Claude Code (project)
.claude/skills/platform-detection/SKILL.md
$ npx degit dotnet/skills/plugins/dotnet-test/skills/platform-detection .claude/skills/platform-detectionInstall the platform-detection skill in Codex
~/.agents/skills/platform-detection/SKILL.md
$ npx degit dotnet/skills/plugins/dotnet-test/skills/platform-detection ~/.agents/skills/platform-detectionInstall the platform-detection skill in Gemini CLI
~/.gemini/skills/platform-detection/SKILL.md
$ npx degit dotnet/skills/plugins/dotnet-test/skills/platform-detection ~/.gemini/skills/platform-detectionInstall the platform-detection skill in Claude.ai
npx degit dotnet/skills/plugins/dotnet-test/skills/platform-detection platform-detection && zip -r platform-detection.zip platform-detection # claude.ai → Customize → Skills → + → Create skill → Upload a skill → platform-detection.zip
Automated checks
Ran Nov 15, 2026Full report →Passed our automated checks. That is not a security audit: read the scripts before you let an agent run them. How checks work
- Source repository linked and reachabledotnet/skills/plugins/dotnet-test/skills/platform-detection is public and reachablegithub.com/dotnet/skills/tree/HEAD/plugins/dotnet-test/skill ↗Pass
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit 2026-11-11github.com/dotnet/skills/commits ↗Pass
- No download-and-run or credential theft in scriptsNo scripts in the skill folderPass
- No hidden instructions in SKILL.mdNo override phrases, safeguard switches, credential requests or hidden charactersgithub.com/dotnet/skills/blob/HEAD/plugins/dotnet-test/skill ↗Pass
- Pre-approved tools are scopedNo pre-approved tools; the agent asks before using onegithub.com/dotnet/skills/blob/HEAD/plugins/dotnet-test/skill ↗Pass
- SKILL.md follows the Agent Skills formatValid name and description; says when to use it; 238 linesgithub.com/dotnet/skills/blob/HEAD/plugins/dotnet-test/skill ↗Pass
SKILL.md
View on GitHubTest Platform and Framework Detection
Determine which test platform (VSTest or Microsoft.Testing.Platform) and which test framework (MSTest, xUnit, NUnit, TUnit) a project uses.
Response contract
Honor the user's requested labels and order exactly, substituting the actual
classification for every placeholder. Start with the verdict: never put a
heading, scratch analysis, tool syntax, or an echoed template before it. Follow
with one concise evidence sentence naming the repository facts needed to justify
every requested classification. When Framework is requested, name the package
or project SDK that identifies it. Use a second sentence only for a conflict, an
incomplete configuration, or target-framework-specific differences.
Platform means the platform that actually executes tests: VSTest or
MTP. If conflicting or incomplete configuration prevents execution, report
it as unavailable rather than inventing a successful platform.
Never classify the executed platform from global.json test.runner alone.
That setting selects dotnet test command mode; even an explicit VSTest
value can bridge to an executable MTP application. Continue through the project
runner, bridge, and output-shape signals before writing Platform:.
Apply this scope gate before drafting the evidence:
| User asks for | Evidence to include | Omit |
|---|---|---|
| Platform and framework | Final runner selector and its winning source; package or project SDK identifying the framework; when needed, the property that makes it executable | Command mode; common SDK facts; OutputType unless it is missing or conflicting |
| The single deciding signal | That runner-selection property, why its source wins, and why a competing package does not select or imply VSTest; still name the package or project SDK identifying a requested framework | Bridge, OutputType, SDK mode, and unrelated prerequisites when the configuration is complete |
| Platforms per target framework | Only the conditional final values that differ by target | Common properties and project-wide SDK commentary |
| Explicit opt-out | Final UseVSTest value and its winning source |
Superseded defaults unless they create a conflict |
dotnet test mode |
The separate command-mode and executed-platform classifications | None of the requested axes |
If the requested labels omit dotnet test mode, do not state or explain command
mode anywhere in the response. An exact bridge property may still be decisive
platform evidence, but do not turn it into SDK or CLI-mode commentary.
When the user asks which single signal decides between an explicit runner
property and Microsoft.NET.Test.Sdk, the evidence sentence must say both that
the runner property selects MTP and that Microsoft.NET.Test.Sdk does not
select or imply VSTest.
When import precedence decides a property, state why the winning source wins (for example, it is imported later or its condition applies), not merely that it contains the final value or overrides another assignment.
Keep the explanation on the requested axis:
- An SDK version pin in
global.jsonis context, not a platform selector. Claim thatglobal.jsonselects VSTest or native MTP only when itstest.runnersetting actually does so. - If
UseVSTest=trueis decisive, say that directly. Do not speculate about an absenttest.runneror describe SDK pinning as an additional platform choice. - If command mode was not requested, do not add it, even when it was needed internally to determine the executed platform.
When a classic-project request also asks for the command family, add a direct
line such as Command family: MSBuild + vstest.console.exe; do not turn it into
an optional alternative or add an unnecessary build qualifier.
For a file-backed request, enumerate the following configuration names once,
then read every relevant file that is present in one batched operation:
global.json, .csproj, packages.config, Directory.Build.props,
Directory.Build.targets, Directory.Packages.props, and explicit imported
.props / .targets. A setting absent from the project file may be defined by
an import, so never infer its final value from the .csproj alone. Do not search
the web or inspect unrelated files when repository configuration is sufficient.
Resolve properties in the actual MSBuild import order, not with a fixed "project beats props" rule. For every applicable target framework:
- Follow the import graph and conditions. A later applicable assignment wins.
Directory.Build.propsis normally imported before the project body, so an unconditional project assignment normally overrides it; later.targetscan override the project again. - Record the final value and its winning source for
UseVSTest, the framework runner selector,TestingPlatformDotnetTestSupport, andOutputType. - Treat
Directory.Packages.propsas version evidence unless it also contains relevant properties. Resolve package/SDK versions before applying version-dependent defaults. - Never infer a property from package presence. A package or SDK default counts only when that resolved version actually supplies it and no later assignment overrides it.
Detecting the project system
Classify the project before selecting a CLI:
- Root
Sdkattribute or<Sdk>declaration: SDK-style. ToolsVersion,Microsoft.Common.props/Microsoft.CSharp.targetsimports, explicit<Reference>and<Compile Include>items: classic non-SDK.packages.config: classic NuGet dependency management.
Classic projects can still use VSTest-compatible adapters, but dotnet test is
not automatically a valid invocation. Preserve repository scripts/CI commands,
commonly MSBuild followed by vstest.console.exe. Mention MSTest.exe only
when repository configuration or documentation establishes that legacy runner.
Detecting the test framework
Read the .csproj, adjacent packages.config, and
Directory.Build.props / Directory.Packages.props and look for:
| Package or SDK reference | Framework |
|---|---|
MSTest metapackage, <Project Sdk="MSTest.Sdk[/version]">, or <Sdk Name="MSTest.Sdk"> |
MSTest |
MSTest.TestFramework + MSTest.TestAdapter |
MSTest (also valid for v3/v4) |
xunit, xunit.v3, xunit.v3.mtp-v1, xunit.v3.mtp-v2, xunit.v3.core.mtp-v1, xunit.v3.core.mtp-v2 |
xUnit |
NUnit + NUnit3TestAdapter |
NUnit |
TUnit |
TUnit (MTP only) |
In classic projects, package IDs and versions may appear only in
packages.config, while the project contains assembly <Reference> elements
with HintPath values. Use both sources.
Detecting the executed test platform
If the user explicitly requests dotnet test mode, read
references/command-mode.md before answering.
Do not load that reference or mention command mode for a
platform/framework-only request.
For an SDK 8/9 request that explicitly asks about command mode and has no
effective bridge, state all three facts in one causal sentence: the runner makes
the project MTP-capable, dotnet test remains in VSTest mode, and the missing
bridge means VSTest actually executes the tests. Mention that native MTP command
mode starts with SDK 10 only when it helps explain that result.
When execution is permitted and neither the prompt nor global.json identifies
the SDK, run dotnet --version once. For read-only identification requests that
prohibit execution, do not probe the installed SDK; use repository facts and
state any necessary SDK assumption.
After resolving final property values, classify in this order:
- Final
UseVSTest=trueselects VSTest. Ifglobal.jsonsimultaneously selects native MTP command mode, reportPlatform: unavailablebecause the command mode and project opt-out conflict. - A native-MTP selection in
global.jsonexecutes a compatible MTP application with finalOutputType=Exeon MTP. A VSTest-only, library-output, or opted-out project is unavailable. - On SDK 8/9, an enabled MTP runner plus final
TestingPlatformDotnetTestSupport=trueplus finalOutputType=Exeexecutes on MTP. - If the runner is enabled but the bridge is absent or false, a dual-capable
MSTest, NUnit, or xUnit project remains on VSTest: the runner establishes MTP
capability, but SDK 8/9
dotnet testcannot reach it and the VSTest adapter executes the tests instead. If the bridge is true but no runner is enabled, the project also remains on VSTest. - A runner and bridge with non-executable output is incomplete and unavailable. An MTP-only framework that cannot be reached by the selected SDK path is also unavailable, not VSTest.
Keep each signal's role exact:
- The runner property selects the test application.
TestingPlatformDotnetTestSupport=truelets SDK 8/9dotnet testreach that application.OutputType=Exesupplies the executable host shape. It does not select or enable MTP.
Do not confuse the MSTest metapackage with the MSTest.Sdk project SDK.
PackageReference Include="MSTest" plus EnableMSTestRunner=true enables the
MSTest MTP runner, but it does not implicitly set
TestingPlatformDotnetTestSupport.
MSTest.Sdk enables the MTP runner by default. Check its resolved version and
evaluated properties for bridge behavior: version 3.8 supplies
TestingPlatformDotnetTestSupport unless a later assignment overrides it,
while newer SDKs on .NET 10 may expect native MTP mode instead.
<UseVSTest>true</UseVSTest> opts back into VSTest.
| Signal | Meaning |
|---|---|
<Project Sdk="MSTest.Sdk..."> with no UseVSTest |
MTP application; inspect the resolved SDK version and evaluated bridge property |
MSTest metapackage + <EnableMSTestRunner>true> |
MTP runner enabled; does not imply the VSTest-to-MTP bridge |
<UseMicrosoftTestingPlatformRunner>true |
Deciding xUnit runner-selection signal |
<EnableMSTestRunner>true> / <EnableNUnitRunner>true> |
Deciding MSTest/NUnit runner-selection signal |
TestingPlatformDotnetTestSupport=true |
Execution prerequisite for a VSTest-to-MTP bridge, not the runner-selection signal |
Microsoft.Testing.Platform package |
MTP-capable application; not decisive by itself |
TUnit |
MTP-only framework |
Final evaluated <OutputType>Exe</OutputType> |
Required executable host shape for package-based MTP applications |
Microsoft.NET.Test.Sdk alone is not decisive; it can remain for compatibility
in an MTP-enabled project. When an explicit override decides the result, name
the final override and its source, not the superseded default.
When a runner-selection property competes with Microsoft.NET.Test.Sdk, say
that the runner property selects MTP and Microsoft.NET.Test.Sdk does not
select or imply VSTest. It may remain as compatibility support, but that is
secondary. TestingPlatformDotnetTestSupport=true is a bridge prerequisite, not
the runner-selection signal; never say that this property alone enables the
bridge. For a request asking which single signal decides, stop there. Omit
bridge or host-shape prerequisites when the configuration is complete, and add
them only when needed to explain why the selected runner cannot execute.
Likewise, when an enabled runner is overridden or unreachable, state both axes
causally: the runner property makes the project MTP-capable, but the final
UseVSTest/bridge/output setting determines which platform actually executes.
Name the runner selector before using a package reference only to identify the
framework.
Use causal evidence, not a bag of signals. For example:
Platform: MTP
Framework: NUnit
Directory.Build.props supplies final EnableNUnitRunner=true and
TestingPlatformDotnetTestSupport=true, so NUnit executes on MTP.
For an incompatible configuration, give one minimal alignment choice after the verdict without modifying files: either select the project's configured platform globally or remove the project opt-out to use the globally selected platform.
Conditional and per-target-framework properties
Evaluate runner and bridge properties for each target framework. If conditions
produce different executed platforms, report each target explicitly (for
example, net8.0: VSTest, net9.0: MTP) rather than collapsing the project to
one global platform.
Files in this skill
2platform-detection skill questions
How do I install the platform-detection skill in Claude Code?
Run npx degit dotnet/skills/plugins/dotnet-test/skills/platform-detection ~/.claude/skills/platform-detection. Claude Code loads skills from ~/.claude/skills (all projects) or .claude/skills (one project) and uses a skill when its description matches the task.
Which clients can use the platform-detection skill?
Any client that reads the Agent Skills format: Claude Code, Codex, Gemini CLI and claude.ai (upload as a ZIP). Scripts in the skill run only where the client allows code execution.
What is the difference between VSTest and MTP?
VSTest is the traditional test platform, while MTP (Microsoft.Testing.Platform) is the newer execution platform. The skill determines which one is actually used based on runner settings, bridge properties, and output types.
Does the presence of Microsoft.NET.Test.Sdk imply the project uses VSTest?
No, the presence of Microsoft.NET.Test.Sdk does not select or imply VSTest; it may remain for compatibility in an MTP-enabled project.