Installing only the latest .NET SDK version (the default).
Installing an additional SDK version. Multiple versions can be specified as comma-separated values.
"features": {
"ghcr.io/devcontainers/features/dotnet:2": {
"version": "latest", // (this can be omitted)
"additionalVersions": "lts"
}
}Installing specific SDK versions.
"features": {
"ghcr.io/devcontainers/features/dotnet:2": {
"version": "6.0",
"additionalVersions": "7.0, 8.0"
}
}Installing a specific SDK feature band.
"features": {
"ghcr.io/devcontainers/features/dotnet:2": {
"version": "6.0.4xx",
}
}Installing a specific SDK patch version.
"features": {
"ghcr.io/devcontainers/features/dotnet:2": {
"version": "6.0.412",
}
}Installing only the .NET Runtime or the ASP.NET Core Runtime. (The SDK includes all runtimes so this configuration is only useful if you need to run .NET apps without building them from source.)
"features": {
"ghcr.io/devcontainers/features/dotnet:2": {
"version": "none",
"dotnetRuntimeVersions": "latest, lts",
"aspNetCoreRuntimeVersions": "latest, lts",
}
}Installing .NET workloads. Multiple workloads can be specified as comma-separated values.
"features": {
"ghcr.io/devcontainers/features/dotnet:2": {
"workloads": "wasm-tools"
}
}Installing prerelease builds. Supports preview and daily suffixes.
"features": {
"ghcr.io/devcontainers/features/dotnet:2": {
"version": "10.0-preview",
"additionalVersions": "10.0.1xx-daily",
"dotnetRuntimeVersions": "10.0-daily",
"aspNetCoreRuntimeVersions": "10.0-daily"
}
}This Feature should work on recent versions of Debian/Ubuntu-based distributions with the apt package manager installed.
bash is required to execute the install.sh script.
When using .NET SDK 10 or newer, tab completions for the dotnet CLI are automatically installed for bash, zsh, and fish. The completion scripts are placed in the standard system-wide directories so they work for all users:
- Bash:
/usr/share/bash-completion/completions/dotnet - Zsh:
/usr/share/zsh/site-functions/_dotnet - Fish:
/usr/share/fish/vendor_completions.d/dotnet.fish
To disable this, set tabCompletions to false:
"features": {
"ghcr.io/devcontainers/features/dotnet:2": {
"tabCompletions": false
}
}