Skip to content
Skills Library
Programming · Building & coding

dotnet

/dotnet

Use when configuring dev containers for .NET projects. Covers the dotnet feature, SDK versions, workloads, C# Dev Kit extensions, and NuGet configuration. USE FOR: .NET dev container setup, dotnet SDK feature, C# Dev Kit extensions, NuGet configuration, .NET workloads in Codespaces DO NOT USE FOR: Python dev containers (use python), TypeScript dev containers (use typescript), .NET Aspire dev containers (use aspire)

Licence
MIT
Last repository change
09.06.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
13
Scripts
0
HTML comments
0
URLs in SKILL.md
2
Deprecation

No signals detected. Repository changed on 09.06.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Use when configuring dev containers for .NET projects. Covers the dotnet feature, SDK versions, workloads, C# Dev Kit extensions, and NuGet configuration. USE FOR: .NET dev container setup, dotnet SDK feature, C# Dev Kit extensions, NuGet configuration, .NET workloads in Codespaces DO NOT USE FOR: Python dev containers (use python), TypeScript dev containers (use typescript), .NET Aspire dev containers (use aspire)

Original author description

Use when configuring dev containers for .NET projects. Covers the dotnet feature, SDK versions, workloads, C# Dev Kit extensions, and NuGet configuration. USE FOR: .NET dev container setup, dotnet SDK feature, C# Dev Kit extensions, NuGet configuration, .NET workloads in Codespaces DO NOT USE FOR: Python dev containers (use python), TypeScript dev containers (use typescript), .NET Aspire dev containers (use aspire)

How it works

  1. Overview
  2. Dotnet Feature
  3. Install Workloads
  4. Full Example
  5. Using the Base Image vs Feature
  6. NuGet Configuration
  7. Multi-Project Solutions
  8. Best Practices
Original SKILL.md headings · 112 lines, 389 words
SKILL.md preview
---
name: dotnet
description: |
    Use when configuring dev containers for .NET projects. Covers the dotnet feature, SDK versions, workloads, C# Dev Kit extensions, and NuGet configuration.
    USE FOR: .NET dev container setup, dotnet SDK feature, C# Dev Kit extensions, NuGet configuration, .NET workloads in Codespaces
    DO NOT USE FOR: Python dev containers (use python), TypeScript dev containers (use typescript), .NET Aspire dev containers (use aspire)
license: MIT
metadata:
  displayName: "Dev Container — .NET"
  author: "Tyler-R-Kendrick"
compatibility: claude, copilot, cursor
references:
  - title: "Dev Containers Specification"
    url: "https://containers.dev/"
  - title: ".NET Official Documentation"
    url: "https://learn.microsoft.com/en-us/dotnet/"
---

# Dev Container — .NET

## Overview
Configure a dev container for .NET development using the official dotnet feature. Supports multiple SDK versions, workloads, and integration with C# Dev Kit.

## Dotnet Feature
```jsonc
{
  "features": {
    "ghcr.io/devcontainers/features/dotnet:2": {
      "version": "9.0",
      "additionalVersions": "8.0"
    }
  }
}
```

### Feature Options
| Option | Default | Description |
|--------|---------|-------------|
| `version` | `latest` | Primary .NET SDK version (`9.0`, `8.0`, `latest`, `none`) |
| `additionalVersions` | | Comma-separated extra SDK versions to install |
| `workloads` | | Comma-separated .NET workloads (e.g., `aspire`, `wasm-tools`, `maui`) |
| `installUsingApt` | `true` | Use apt package manager when available |

## Install Workloads
```jsonc
{
  "features": {
    "ghcr.io/devcontainers/features/dotnet:2": {
      "version": "9.0",
      "workloads": "aspire, wasm-tools"
    }
  }
}
```

## Full Example
```jsonc
{
  "name": ".NET 9 Development",
  "image": "mcr.microsoft.com/devcontainers/dotnet:9.0",
  "features": {
    "ghcr.io/devcontainers/features/github-cli:1": {}
  },
  "forwardPorts": [5000, 5001],
  "portsAttributes": {
    "5000": { "label": "HTTP", "onAutoForward": "notify" },
    "5001": { "label": "HTTPS", "onAutoForward": "notify" }
  },
  "postCreateCommand": "dotnet restore",
  "customizations": {
    "vscode": {
      "extensions": [
        "ms-dotnettools.csdevkit",
        "ms-dotnettools.csharp"
      ],
      "settings": {
        "dotnet.defaultSolution": "MyApp.sln"
      }
    }
  }
}
```

## Using the Base Image vs Feature
| Approach | When to Use |
|----------|-------------|
| `"image": "mcr.microsoft.com/devcontainers/dotnet:9.0"` | .NET-only projects; comes preconfigured |
| Base image + `ghcr.io/devcontainers/features/dotnet:2` | Multi-language projects; compose with other features |

## NuGet Configuration
Mount a local NuGet config or set package sources via environment variables:
```jsonc
{
  "containerEnv": {
    "NUGET_PACKAGES": "/home/vscode/.nuget/packages",
    "DOTNET_CLI_TELEMETRY_OPTOUT": "1"
  },
  "mounts": [
    "source=${localEnv:HOME}/.nuget,target=/home/vscode/.nuget,type=bind,consistency=cached"
  ]
}
```

## Multi-Project Solutions
For solutions with multiple projects, set the workspace folder and default solution:
```jsonc
{
  "workspaceFolder": "/workspace",
  "customizations": {
    "vscode": {
      "settings": {
        "dotnet.defaultSolution": "src/MyApp.sln",
        "omnisharp.enableMsBuildLoadProjectsOnDemand": true
      }
    }
  },
  "postCreateCommand": "dotnet restore src/MyApp.sln"
}
```

## Best Practices
- Use the dedicated `mcr.microsoft.com/devcontainers/dotnet` image for .NET-only projects — it includes the SDK, runtime, and common tools.
- Use the dotnet feature on a base image when you need .NET alongside other languages.
- Pin to a major SDK version (`9.0`, `8.0`) rather than `latest` for reproducibility.
- Install workloads via the feature's `workloads` option rather than in `postCreateCommand` so they are cached in prebuilds.
- Add `ms-dotnettools.csdevkit` for full IDE experience (solution explorer, test explorer, refactoring).
- Set `DOTNET_CLI_TELEMETRY_OPTOUT=1` in `containerEnv` for CI-like environments.
- Forward ports 5000/5001 for Kestrel HTTP/HTTPS and use `portsAttributes` for auto-open behavior.
Files in this package (13)
  • AGENTS.md 3 KB
  • README.md 1 KB
  • SKILL.md 4 KB
  • metadata.json 1 KB
  • rules/_sections.md 1 KB
  • rules/_template.md 1 KB
  • rules/dotnet-add-ms-dotnettools.md 1 KB
  • rules/dotnet-forward-ports-5000-5001-for-kestrel-http-https-and-use.md 1 KB
  • rules/dotnet-install-workloads-via-the-feature-s-workloads-option.md 1 KB
  • rules/dotnet-pin-to-a-major-sdk-version-9.md 1 KB
  • rules/dotnet-set-dotnet-cli-telemetry-optout-1-in-containerenv-for.md 1 KB
  • rules/dotnet-use-the-dedicated-mcr.md 1 KB
  • rules/dotnet-use-the-dotnet-feature-on-a-base-image-when-you-need.md 1 KB

Versions

RepositoryScoreLicence
This page · Tyler-R-Kendrick/agent-skills100MIT
appwrite/claude-plugin100BSD-3-Clause
managedcode/dotnet-skills90MIT
angri450/Nong.Dev.Net90Apache-2.0

Database snapshot: 13.11.2026 · package version 8b41caf9cc78 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100aspire
    Use when configuring dev containers for .NET Aspire projects. Covers the Aspire workload, Docker-in-Docker requirement, dashboard port forwarding, and multi-service orchestration in Codespaces. USE FOR: .NET Aspire dev containers, Aspire workload in Codespaces, Aspire dashboard…
  • 100typescript
    Use when configuring dev containers for TypeScript or Node.js projects. Covers the Node feature, package managers, ESLint/Prettier extensions, and frontend dev server setup. USE FOR: TypeScript/Node.js dev container setup, Node feature, npm/pnpm/yarn configuration,…
  • 100nuget-manager
    Manage NuGet packages in .NET projects/solutions. Use this skill when adding, removing, or updating NuGet package versions. It enforces using `dotnet` CLI for package management and provides strict procedures for direct file edits only when updating versions.
  • 100nuget-manager
    Manage NuGet packages in .NET projects/solutions. Use this skill when adding, removing, or updating NuGet package versions. It enforces using `dotnet` CLI for package management and provides strict procedures for direct file edits only when updating versions.
  • 100dotnet-update-packages
    Lists and updates outdated NuGet packages in .NET projects. Also use when the user mentions "update packages," "outdated NuGet," "upgrade dependencies," "dotnet package update," "check for updates," or "package versions." For centralizing package versions, see dotnet-centralise-packages.
  • 98dotnet-framework
    Guidance for working with .NET Framework projects. Includes project structure, C# language version, NuGet management, and best practices. Triggers on: **/*.csproj, **/*.cs

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.