building-code

Restores and builds the WinForms repository using Arcade build scripts.

1.2k|337|Updated Oct 13, 2022
One-click install
npx skills add https://github.com/dotnet/dotnet --skill building-code
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: building-code
Source: https://github.com/dotnet/dotnet/tree/main/src/winforms/.github/skills/building-code
Command: npx skills add https://github.com/dotnet/dotnet --skill building-code

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Building the WinForms repository correctly requires the Arcade build system, not a plain dotnet build, because only build.cmd applies the CI analyzers, PublicAPI checks, and warn-as-error settings that determine whether a change actually passes the official build.

Core Features & Use Cases

  • Guided restore and full builds: Runs Restore.cmd and build.cmd with the repo-local SDK pinned in global.json, including clean, release, and packaging workflows.
  • Fast inner-loop builds: Builds a single project with dotnet build for quick iteration after an initial full restore.
  • Troubleshooting support: Diagnoses build errors using binary logs in artifacts\log and the MSBuild Structured Log Viewer.
  • Use Case: After editing System.Windows.Forms source code, run a single-project build to iterate quickly, then verify with build.cmd before claiming the change compiles cleanly in CI.

Quick Start

Ask the assistant to restore and build the WinForms solution with build.cmd and report which assemblies succeeded or failed.

Frequently Asked Questions about building-code

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

FAQPage Schema
How do I build the WinForms repository from the command line?

Run .\Restore.cmd once to download the repo-local SDK and packages, then run .\build.cmd to build Winforms.sln in Debug. Use .\build.cmd -configuration Release for release builds or add -pack to create NuGet packages.

Why should I use build.cmd instead of dotnet build for WinForms?

Only build.cmd applies the Arcade CI configuration, including the PublicAPI analyzer, code-style analyzers, and warn-as-error. A plain dotnet build of the solution skips these checks, so zero warnings there does not mean CI will pass.

Can I build WinForms on Linux?

Linux is supported for command-line restore and build only, using build.sh instead of build.cmd and Restore.cmd. Windows is required for WinForms runtime scenarios, test execution, and Visual Studio workflows.

How do I build a single WinForms project quickly?

After at least one successful Restore.cmd or build.cmd, run dotnet build on the specific csproj, such as src\System.Windows.Forms\System.Windows.Forms.csproj. This inner-loop build is faster but must be re-verified with build.cmd before claiming a clean build.

How do I troubleshoot WinForms build errors?

Most errors are compile errors fixed normally. For MSBuild task errors, inspect the binary log at artifacts\log\Debug\Build.binlog with the MSBuild Structured Log Viewer, and run Restore.cmd if the SDK version pinned in global.json is missing.