scaffold-dotnet-test-project

Creates, registers, and repairs .NET test projects for solution and CI test discovery.

5.3k|403|Updated Feb 3, 2026
One-click install
npx skills add https://github.com/dotnet/skills --skill scaffold-dotnet-test-project
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: scaffold-dotnet-test-project
Source: https://github.com/dotnet/skills/tree/main/plugins/dotnet-test/skills/scaffold-dotnet-test-project
Command: npx skills add https://github.com/dotnet/skills --skill scaffold-dotnet-test-project

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Test projects often fail to appear in solution-level or CI test runs because of missing ProjectReference entries, absent .sln/.slnx/.slnf registration, or mismatched framework and package conventions. This Skill creates the minimal missing test project or repairs only the broken wiring so the repository's real build entry point discovers and runs the tests.

Core Features & Use Cases

  • Bounded project creation: Scaffolds a single xUnit, NUnit, or MSTest project aligned with the repository's target framework, nullable, implicit-usings, and central package management conventions.
  • Wiring repair: Adds missing ProjectReference entries or registers existing projects in .sln, .slnx, or .slnf files without touching test source code.
  • Verified discovery: Runs the exact entry-point command CI uses and confirms the test project appears in solution listings before reporting success.
  • Use Case: A developer's new xUnit v3 test project passes with dotnet test on the project directly but CI discovers zero tests; this Skill registers the project in the .slnx file CI builds and verifies discovery through that exact command.

Quick Start

Set up a test project for my .NET solution and make sure CI discovers and runs its tests.

Frequently Asked Questions about scaffold-dotnet-test-project

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

FAQPage Schema
How do I add a test project to a .NET solution?

Run dotnet sln <solution> add <test-project> against the exact .sln or .slnx file CI uses, then verify with dotnet sln list on that same path. Confirm discovery by running dotnet test through the solution entry point, not just the project directly.

Why does dotnet test find zero tests in my solution?

Zero-test discovery usually means the test project is not registered in the .sln, .slnx, or .slnf file CI builds, or it lacks a ProjectReference to the production code. Inspect the exact entry point CI invokes and register the existing project rather than creating a new one.

How do I set up an xUnit v3 test project with dotnet test?

An xUnit v3 project needs OutputType set to Exe and TestingPlatformDotnetTestSupport set to true so dotnet test can discover it. Avoid generic dotnet new xunit templates that emit xUnit 2 packages when the repository uses centrally managed xunit.v3.

Should I create a new test project or reuse an existing one?

Reuse an existing project when its target framework can reference the production project and its purpose matches the requested test layer. Create a new project only when no suitable one exists, and reference only the production projects the requested tests exercise.

When should I not use this test scaffolding approach?

Do not use it to author tests inside an already-wired project, run existing test suites, migrate test frameworks, or fix MSTest syntax without changing project or CI files. Those tasks belong to test authoring, execution, or migration workflows instead.