# dotnet-winforms-basics

dotnet-winforms-basics teaches coding agents how to build WinForms apps on modern .NET 8+. Helps configure dependency injection, SDK-style projects, and high-DPI scaling.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 295 installs · ★ 92 repo stars
- Author: wshaddix
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/wshaddix/dotnet-skills/tree/HEAD/skills/dotnet-winforms-basics/SKILL.md
- Updated: 2026-02-27
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/dotnet-winforms-basics

## What it does

This skill directs coding assistants to modern WinForms conventions under `net8.0-windows`. It replaces obsolete project structures with SDK-style project files. Forms and background services resolve through the generic Host builder, establishing proper dependency injection directly from `Program.cs`.

Display handling focuses on multi-monitor environments. The guidance sets `PerMonitorV2` before calling `ApplicationConfiguration.Initialize()`, preventing blurred windows. It also instructs the agent to avoid fixed pixel layouts in favor of `TableLayoutPanel` and `AutoScaleMode.Dpi`.

The boundary is deliberate: it targets .NET 8 and newer runtimes exclusively. Legacy .NET Framework practices and desktop test suites live in separate skills, so using this guide for migration tasks will fall outside its scope.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add wshaddix/dotnet-skills --skill dotnet-winforms-basics -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/dotnet-winforms-basics/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/dotnet-winforms-basics/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add wshaddix/dotnet-skills --skill dotnet-winforms-basics -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/dotnet-winforms-basics/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add wshaddix/dotnet-skills --skill dotnet-winforms-basics -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/dotnet-winforms-basics/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install wshaddix/dotnet-skills skills/dotnet-winforms-basics
```

2. **Manually: put the files in place**
- File: `.github/skills/dotnet-winforms-basics/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add wshaddix/dotnet-skills --skill dotnet-winforms-basics -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/wshaddix/dotnet-skills --path skills/dotnet-winforms-basics
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/dotnet-winforms-basics/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add wshaddix/dotnet-skills --skill dotnet-winforms-basics -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/wshaddix/dotnet-skills/tree/HEAD/skills/dotnet-winforms-basics/SKILL.md

## When to use it
- configure SDK-style WinForms projects for `net8.0-windows`
- wire up generic Host builder for dependency injection in forms
- enable `PerMonitorV2` mode for crisp high-DPI scaling
- isolate Visual Studio designer scaling with `ForceDesignerDPIUnaware`

## Example prompts
- Set up `Program.cs` for WinForms on .NET 8 with generic Host DI.
- Configure `PerMonitorV2` high-DPI mode before `ApplicationConfiguration.Initialize()`.
- Add `ForceDesignerDPIUnaware` to the project file for designer stability.

## Similar
- [winforms-expert](https://affpapa.org/en/nevibecode/skills/winforms-expert.md) — skill · 2000 installs
- [dotnet-best-practices](https://affpapa.org/en/nevibecode/skills/dotnet-best-practices.md) — skill · 15752 installs
- [vb-winforms](https://affpapa.org/en/nevibecode/skills/vb-winforms.md) — skill · 366 installs
- [generate-testability-wrappers](https://affpapa.org/en/nevibecode/skills/generate-testability-wrappers.md) — skill · 4400 installs
- [dependency-injection](https://affpapa.org/en/nevibecode/skills/dependency-injection.md) — skill · 4000 installs
- [dependency-injection-patterns](https://affpapa.org/en/nevibecode/skills/dependency-injection-patterns.md) — skill · 715 installs

From the same set: [wshaddix/dotnet-skills](https://affpapa.org/en/nevibecode/by/wshaddix/dotnet-skills.md) — 24 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
