PL

platform-detection

A background utility that identifies which .NET test runner and framework a project uses by inspecting project configuration files.

Install

mkdir -p .claude/skills/platform-detection && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/17294" && unzip -o skill.zip -d .claude/skills/platform-detection && rm skill.zip

Installs to .claude/skills/platform-detection

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Reference data for detecting the test platform (VSTest vs Microsoft.Testing.Platform) and test framework (MSTest, xUnit, NUnit, TUnit) from project files. DO NOT USE directly — loaded by run-tests, mtp-hot-reload, and migrate-vstest-to-mtp when they need detection logic.
271 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Beginner

Key capabilities

  • Detect the test platform (VSTest or Microsoft.Testing.Platform)
  • Detect the test framework (MSTest, xUnit, NUnit, TUnit)
  • Inspect `global.json` for test runner settings
  • Examine `.csproj` files for package references and SDKs
  • Check `Directory.Build.props` and `Directory.Packages.props` for test configurations

How it works

The skill analyzes project configuration files like `global.json` and `.csproj` to identify specific package references, SDKs, and MSBuild properties. This information determines the test platform and framework in use.

Inputs & outputs

You give it
Project files such as `global.json`, `.csproj`, `Directory.Build.props`, `Directory.Packages.props`
You get back
Identification of the test platform (VSTest or Microsoft.Testing.Platform) and test framework (MSTest, xUnit, NUnit, TUnit)

When to use platform-detection

  • Identifying the test framework for automated migration tasks
  • Determining the correct test runner for CI/CD pipeline configurations
  • Validating project compatibility before hot-reloading tests
  • Scanning dependency files to detect test metapackages

About this skill

Test Platform and Framework Detection

Determine which test platform (VSTest or Microsoft.Testing.Platform) and which test framework (MSTest, xUnit, NUnit, TUnit) a project uses.

Detection files to always check (in order): global.json.csprojDirectory.Build.propsDirectory.Packages.props

Detecting the test framework

Read the .csproj file and Directory.Build.props / Directory.Packages.props (for centrally managed dependencies) and look for:

Package or SDK referenceFramework
MSTest (metapackage, recommended) or <Sdk Name="MSTest.Sdk">MSTest
MSTest.TestFramework + MSTest.TestAdapterMSTest (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-v2xUnit
NUnit + NUnit3TestAdapterNUnit
TUnitTUnit (MTP only)

Detecting the test platform

The detection logic depends on the .NET SDK version. Run dotnet --version to determine it.

.NET SDK 10+

On .NET 10+, the global.json test.runner setting is the authoritative source:

  • If global.json contains "test": { "runner": "Microsoft.Testing.Platform" }MTP
  • If global.json has "runner": "VSTest", or no test section exists → VSTest

Important: On .NET 10+, <TestingPlatformDotnetTestSupport> alone does not switch to MTP. The global.json runner setting takes precedence. If the runner is VSTest (or unset), the project uses VSTest regardless of TestingPlatformDotnetTestSupport.

.NET SDK 8 or 9

On older SDKs, check these signals in priority order:

1. Check the <TestingPlatformDotnetTestSupport> MSBuild property. Look in the .csproj, Directory.Build.props, and Directory.Packages.props. If set to true in any of these files, the project uses MTP.

Critical: Always read Directory.Build.props and Directory.Packages.props if they exist. MTP properties are frequently set there instead of in the .csproj, so checking only the project file will miss them.

2. Check project-level signals:

SignalPlatform
<Sdk Name="MSTest.Sdk"> as project SDKMTP by default
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>MTP runner (xUnit)
<EnableMSTestRunner>true</EnableMSTestRunner>MTP runner (MSTest)
<EnableNUnitRunner>true</EnableNUnitRunner>MTP runner (NUnit)
Microsoft.Testing.Platform package referenced directlyMTP
TUnit package referencedMTP (TUnit is MTP-only)

Note: The presence of Microsoft.NET.Test.Sdk does not necessarily mean VSTest. Some frameworks (e.g., MSTest) pull it in transitively for compatibility, even when MTP is enabled. Do not use this package as a signal on its own — always check the MTP signals above first. Key distinction: VSTest is the classic platform that uses vstest.console under the hood. Microsoft.Testing.Platform (MTP) is the newer, faster platform. Both can be invoked via dotnet test, but their filter syntax and CLI options differ.

When not to use it

  • Direct invocation by a user
  • When the goal is not to detect test platform or framework

Limitations

  • Not user-invocable
  • Does not perform any actions beyond detection
  • Requires other skills to consume its detection logic

How it compares

This skill provides a standardized, programmatic method for identifying test platforms and frameworks by inspecting project files, which is more reliable and faster than a manual review of project configurations.

Compared to similar skills

platform-detection side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
platform-detection (this skill)020dNo flagsBeginner
run-device-tests31moReviewAdvanced
tunit02moReviewIntermediate
csharp-pro93moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

run-device-tests

dotnet

Build and run .NET MAUI device tests locally with category filtering. Supports iOS, MacCatalyst, Android on macOS; Android, Windows on Windows. Use TestFilter to run specific test categories.

325

tunit

managedcode

Write, run, or repair .NET tests that use TUnit. Use when a repo uses `TUnit`, `TUnit.Playwright`, `[Test]`, `[Arguments]`, `ClassDataSource`, `SharedType.PerTestSession`, or Microsoft.Testing.Platform-based. USE FOR: the repo uses TUnit; you need to add, run, debug, or repair TUnit tests; the repo

00

csharp-pro

sickn33

Write modern C# code with advanced features like records, pattern matching, and async/await. Optimizes .NET applications, implements enterprise patterns, and ensures comprehensive testing. Use PROACTIVELY for C# refactoring, performance optimization, or complex .NET solutions.

953

performance-benchmark

dotnet

Generate and run ad hoc performance benchmarks to validate code changes. Use this when asked to benchmark, profile, or validate the performance impact of a code change in dotnet/runtime.

328

backend-testing

exceptionless

Backend testing with xUnit, Foundatio.Xunit, integration tests with AppWebHostFactory, FluentClient, ProxyTimeProvider for time manipulation, and test data builders. Keywords: xUnit, Fact, Theory, integration tests, AppWebHostFactory, FluentClient, ProxyTimeProvider, TimeProvider, Foundatio.Xunit, TestWithLoggingBase, test data builders

316

bunit-test-migration

FritzAndFriends

Migrate bUnit test files from deprecated beta API (1.0.0-beta-10) to bUnit 2.x stable API. Use this when working on .razor test files in BlazorWebFormsComponents.Test that contain old patterns like TestComponentBase, Fixture, or SnapshotTest.

110

Search skills

Search the agent skills registry