platform-detection

Detect .NET test platform and framework from project configuration files.

1|Updated May 21, 2026
One-click install
npx skills add https://github.com/1k-off/umbraco-observability-playground --skill platform-detection-1k-off
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: platform-detection
Source: https://github.com/1k-off/umbraco-observability-playground/tree/main/.agents/skills/platform-detection
Command: npx skills add https://github.com/1k-off/umbraco-observability-playground --skill platform-detection-1k-off

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the problem of figuring out whether a .NET test project should run with VSTest or Microsoft.Testing.Platform, and which test framework (MSTest, xUnit, NUnit, TUnit) it uses, using the project’s existing configuration files.

Core Features & Use Cases

  • Framework detection from project and central props: Infers MSTest, xUnit, NUnit, or TUnit by inspecting package/SDK references in the .csproj and Directory.Build.props/Directory.Packages.props.
  • Platform detection by SDK rules: Uses dotnet SDK version to choose the correct detection strategy, including global.json runner precedence on .NET 10+.
  • Central configuration support: Correctly identifies MTP when centrally managed properties are set outside the .csproj, which prevents misclassification in real monorepos.

Quick Start

Ask the agent to determine the test platform (VSTest vs Microsoft.Testing.Platform) and test framework (MSTest, xUnit, NUnit, TUnit) for your repository by checking global.json, the .csproj, and the relevant Directory.Build.props / Directory.Packages.props files in the right priority order.

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 test project uses VSTest or Microsoft.Testing.Platform?

To detect the .NET test platform, inspect global.json for the dotnet SDK version and apply runner precedence rules, checking .csproj and Directory.Build.props for specific MSBuild properties to determine VSTest versus Microsoft.Testing.Platform usage.

What is the best way to identify which test framework a .NET project targets?

Identifying the test framework involves inspecting package and SDK references within the .csproj alongside centrally managed properties in Directory.Build.props and Directory.Packages.props to accurately infer MSTest, xUnit, NUnit, or TUnit.

Does global.json affect test platform detection in .NET 10+?

Yes, global.json affects test platform detection in .NET 10+ by defining the dotnet SDK version, which determines the runner precedence strategy used to choose between VSTest and Microsoft.Testing.Platform.

How do I find test framework references in a centrally managed .NET monorepo?

Finding test framework references in a centrally managed monorepo requires reading Directory.Build.props and Directory.Packages.props in a defined priority order to correctly identify package signals and prevent misclassification.

Why does my test runner selection fail when using central package management?

Test runner selection fails because central configuration properties set outside the .csproj are overlooked; proper detection requires reading Directory.Build.props and Directory.Packages.props to find the correct MSBuild and package signals.

Can I determine the correct test runner without manually checking every MSBuild property?

Yes, by applying dotnet SDK version rules and specific package signals from your project files, you can deterministically detect the correct test runner across varying SDK versions without manually verifying every MSBuild property.