run-tests
Recommend or run the exact `dotnet test` command. ALWAYS use when the user asks to run, filter, or troubleshoot .NET tests or wants the precise command, flags, or argument order — the right syntax depends on the test platform (VSTest vs Microsoft.Testing.Platform) and SDK version and is easy to get wrong from memory. USE FOR: running all tests or a subset (a specific class, category, or trait) via filters; a single framework in a multi-TFM project (`--framework`); TRX reports; crash or hang dumps; whether MTP args need the `--` separator (SDK 8/9) or pass directly (SDK 10+); diagnosing why `do
npx skills add dotnet/skills --skill run-tests --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Run .NET Tests Detect the test platform and framework, run tests, and apply filters using `dotnet test`. ## When to Use - User wants to run tests in a .NET project - User needs to run a subset of tests using filters - User needs help detecting which test platform (VSTest vs MTP) or framework is in use - User wants to understand the correct filter syntax for their setup ## When Not to Use - User needs to write or generate test code (use `writing-mstest-tests` for MSTest, or general coding assistance for other frameworks) - User needs to migrate from VSTest to MTP (use `migrate-vstest-to-mtp`) - User wants to iterate on failing tests without rebuilding (use `mtp-hot-reload`) - User needs CI/CD pipeline configuration (use CI-specific skills) - User needs to debug a test (use debugging skills) ## Inputs | Input | Required | Description | |-------|----------|-------------| | Project or solution path | No | Path to the test project (.csproj) or solution (.sln, .slnf, .slnx). Defaults to current directory. | | Filter expression | No | Filter expression to select specific tests | | Target framework | No | Target framework moniker to run against (e.g., `net8.0`) | ## Critical Rules — Avoi
- When to Use
- When Not to Use
- Inputs
- Critical Rules — Avoid Cross-Platform Mistakes
- Workflow
- Quick Reference
- Step 1: Detect the test platform and framework
- Step 2: Run tests
- Step 3: Run filtered tests
- Validation
- Common Pitfalls
- Troubleshooting
dotnet test [<PROJECT> | <SOLUTION> | <DIRECTORY> | <DLL> | <EXE>] dotnet test [<PROJECT> | <SOLUTION> | <DIRECTORY> | <DLL> | <EXE>] -- <MTP_ARGUMENTS> dotnet test Run all tests in a project dotnet test --project path/to/MyTests.csproj Run all tests in a directory containing a project dotnet test --project path/to/ Run all tests in a solution (sln, slnf, slnx) dotnet test --solution path/to/MySolution.sln dotnet test --solution path/to/MySolution.slnf
What does the run-tests skill do?
Recommend or run the exact `dotnet test` command. ALWAYS use when the user asks to run, filter, or troubleshoot .NET tests or wants the precise command, flags, or argument order — the right syntax depends on the test platform (VSTest vs Microsoft.Testing.Platform) and SDK version and is easy to get wrong from memory. USE FOR: running all tests or a subset (a specific class, category, or trait) via filters; a single framework in a multi-TFM project (`--framework`); TRX reports; crash or hang dumps; whether MTP args need the `--` separator (SDK 8/9) or pass directly (SDK 10+); diagnosing why `do
How do I install it?
Run `npx skills add dotnet/skills --skill run-tests --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From dotnet/skills, a repository with 4,927 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
