setup-local-sdk
Fungsinya
Skill ini memasang SDK .NET ke folder lokal proyek, sehingga Anda bisa menguji pratinjau atau versi tertentu tanpa mengubah instalasi .NET utama di komputer. Skill ini untuk pengembang yang menginginkan pengaturan yang terisolasi atau dapat direproduksi.
Kapan dipakai
- βSaat Anda ingin mencoba pratinjau .NET tanpa mengubah instalasi .NET di seluruh sistem.
- βSaat sebuah proyek harus memakai satu versi SDK .NET yang tepat untuk semua anggota tim.
- βSaat Anda ingin skrip instalasi yang bisa diulang untuk tim atau pengaturan CI.
Link skill
https://github.com/dotnet/skills/blob/main/plugins/dotnet/skills/setup-local-sdk/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βPasang SDK pratinjau .NET 11 di dalam folder proyek ini agar saya bisa mengujinya tanpa mengubah .NET di komputer saya.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent memasang SDK yang dipilih ke folder di dalam proyek, lalu mengatur global.json agar perintah dotnet di folder itu otomatis memakainya.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
setup-local-sdk
Purpose
Guide the user through installing a .NET SDK into a project-local .dotnet/
directory and wiring it up via the global.json paths feature (.NET 10+).
The examples use .NET 11, but this works with any version β prerelease or stable.
The result is a fully isolated SDK that:
- Does not modify the system-wide .NET installation.
- Is picked up automatically by
dotnetcommands from the project root. - Can be deleted to revert (
rm -rf .dotnet/orRemove-Item -Recurse -Force .\.dotnet).
When NOT to use
- User wants a system-wide install β direct to the official installer.
- Host
dotnetis older than v10 βpathsdoesn't exist; explain and stop. - User needs a runtime-only install β
pathsapplies to SDK resolution only.
Inputs / Prerequisites
| Input | Required | Default | Notes |
|---|---|---|---|
| Channel or version | No | 11.0 |
e.g. 11.0, STS, LTS, or an exact version like 11.0.100-preview.2.26159.112 |
| Quality | No | preview |
One of: daily, preview, ga |
| jq | No | β | Optional for bash team scripts when patching an existing global.json; without it, do not overwrite the file |
Prerequisites
- A .NET 10+ SDK is installed globally β run
dotnet --version; major β₯ 10. - curl (macOS/Linux) or PowerShell (Windows) is available.
Workflow
Step 1 β Clarify what to install
If the user didn't specify, ask what .NET SDK version they want (e.g., "latest
.NET 11 preview" or an exact version like 11.0.100-preview.2.26159.112).
Map the answer to --channel/--quality or --version flags.
Step 2 β Verify .NET 10+ host
If the user already provided dotnet --version output, treat that as the
authoritative version for their machine. Do not override it with the agent
workspace's version; if the two differ, explain that the workspace differs and
continue advising for the user's machine.
dotnet --version
If major version < 10, stop before downloading anything: the paths feature
requires a .NET 10+ host SDK. Tell the user to install .NET 10 or later
system-wide first, then return to the local SDK setup.
Step 3 β Detect operating system
Run uname -s 2>/dev/null. If it succeeds (including MINGW*, MSYS*, CYGWIN* β
these are bash-capable environments like Git Bash) β use bash/dotnet-install.sh.
If it fails (native Windows without Git Bash) β use PowerShell/dotnet-install.ps1.
Step 4 β Check for existing local SDK
macOS / Linux:
test -d .dotnet && echo "exists" || echo "not found"
Windows (PowerShell):
if (Test-Path -LiteralPath .\.dotnet) { "exists" } else { "not found" }
If .dotnet/ exists, ask: update with the new version, or skip and keep it?
Step 5 β Download and run the install script
macOS / Linux:
INSTALL_SCRIPT="$(mktemp "${TMPDIR:-/tmp}/dotnet-install.XXXXXX")"
trap 'rm -f "$INSTALL_SCRIPT"' EXIT
curl -fsSL https://dot.net/v1/dotnet-install.sh -o "$INSTALL_SCRIPT"
bash "$INSTALL_SCRIPT" --channel <CHANNEL> --quality <QUALITY> --install-dir .dotnet
Windows (PowerShell):
$installScript = Join-Path $env:TEMP "dotnet-install-$([guid]::NewGuid()).ps1"
try {
Invoke-WebRequest -Uri 'https://dot.net/v1/dotnet-install.ps1' -OutFile $installScript
& $installScript -Channel <CHANNEL> -Quality <QUALITY> -InstallDir .dotnet
}
finally {
if (Test-Path -LiteralPath $installScript) {
Remove-Item -LiteralPath $installScript -Force
}
}
For exact versions: use --version <VERSION> (bash) or -Version <VERSION> (PowerShell)
instead of channel/quality flags. The install scripts are from Microsoft's official
URLs: https://dot.net/v1/dotnet-install.sh and https://dot.net/v1/dotnet-install.ps1.
Step 6 β Identify the installed version
./.dotnet/dotnet --version # macOS/Linux
.\.dotnet\dotnet.exe --version # Windows
Record the exact version string (e.g., 11.0.100-preview.2.26159.112) for global.json.
Step 7 β Create or update global.json
{
"sdk": {
"version": "<INSTALLED_VERSION>",
"allowPrerelease": true,
"rollForward": "latestFeature",
"paths": [".dotnet", "$host$"],
"errorMessage": "Required .NET SDK not found. Run ./install-dotnet.sh (or .ps1) to install it locally."
}
}
paths:.dotnetfirst (local priority),$host$= system-wide fallback.rollForward: "latestFeature": use
Pertanyaan umum
Bagaimana cara membatalkannya?
Anda menghapus folder SDK lokal, yang menghapus instalasi terisolasi.
Apakah perlu .NET yang lebih baru sudah terpasang?
Ya. Fitur path di global.json membutuhkan SDK .NET 10 atau yang lebih baru di host.
Apakah skill ini hanya memasang runtime?
Tidak. Skill ini untuk instalasi SDK, sehingga pengaturan khusus runtime membutuhkan pendekatan lain.
Detail
Deskripsi asli dari pembuat
Install a .NET SDK locally for safe preview testing, specific-version pinning, or reproducible team setups β without modifying the system-wide installation. USE FOR: trying .NET previews safely, testing specific SDK versions, installing MAUI or other workloads on a preview, updating or replacing an existing local SDK, creating reproducible team/CI install scripts, configuring global.json paths. DO NOT USE FOR: system-wide SDK installs, .NET hosts older than 10, runtime-only installs, or projects not using SDK-style commands.
repo: dotnet/skills
Popularitas
- Bintang GitHub
- 5.8k
- Peringkat
- #14654
- Lisensi
- MIT
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill lain dari repositori ini
create-custom-agent
5.8kMembantu agent Anda membuat file agen kustom VS Code dengan alatnya sendiri, instruksi, dan serah terima ke agent lain.
create-skill
5.8kMembantu agent Anda membuat skill agent baru dengan nama yang valid, deskripsi pemicu yang jelas, dan file SKILL.md yang mengikuti standar.
csharp-scripts
5.8kMembantu agent Anda menjalankan program C# kecil sebagai satu file dengan alat baris perintah .NET, tanpa membuat proyek lengkap.
dotnet-pinvoke
5.8kMembantu agent Anda memanggil pustaka native C atau C++ dari .NET dengan benar, mencakup tanda tangan, penanganan string, memori, dan safe handle.
Skill serupa
openclaw-update
394kMembantu agent Anda memperbarui OpenClaw Gateway yang sudah ada, dengan memilih metode pembaruan yang sesuai cara pemasangannya dan menjaga sesi Anda tetap berjalan.
diagnose-gateway
394kMembantu agent Anda mencari tahu mengapa OpenClaw Gateway gagal dengan memeriksa pengaturan, channel, dan port tanpa mengubah apa pun.
crabbox-apps
394kMembantu agent Anda membuka dan menjalankan aplikasi di mesin cloud sementara, lalu menampilkan tampilannya di panel samping chat Anda.