본문으로 건너뛰기
Skillpedia
배포 및 클라우드 (DevOps)5.8k · #14654

setup-local-sdk

하는 일

이 스킬은 프로젝트 전용 폴더에 .NET SDK를 설치해, 컴퓨터의 기본 .NET 설치를 바꾸지 않고 프리뷰나 특정 버전을 시험할 수 있게 합니다. 격리되었거나 재현 가능한 환경을 원하는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓컴퓨터 전체의 .NET 설치를 바꾸지 않고 .NET 프리뷰를 시험하고 싶을 때.
  • ✓프로젝트가 팀 모두에게 정확히 하나의 .NET SDK 버전을 쓰도록 해야 할 때.
  • ✓팀이나 CI 설정을 위해 반복 가능한 설치 스크립트가 필요할 때.

스킬 링크

https://github.com/dotnet/skills/blob/main/plugins/dotnet/skills/setup-local-sdk/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/dotnet/skills/blob/main/plugins/dotnet/skills/setup-local-sdk/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 프로젝트 폴더 안에 .NET 11 프리뷰 SDK를 설치해서, 제 컴퓨터의 .NET을 바꾸지 않고 시험할 수 있게 해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트가 선택한 SDK를 프로젝트 안의 폴더에 설치하고, 그 폴더에서 dotnet 명령이 자동으로 그것을 쓰도록 global.json을 설정합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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 dotnet commands from the project root.
  • Can be deleted to revert (rm -rf .dotnet/ or Remove-Item -Recurse -Force .\.dotnet).

When NOT to use

  • User wants a system-wide install — direct to the official installer.
  • Host dotnet is older than v10 — paths doesn't exist; explain and stop.
  • User needs a runtime-only install — paths applies 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

  1. A .NET 10+ SDK is installed globally — run dotnet --version; major ≥ 10.
  2. 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: .dotnet first (local priority), $host$ = system-wide fallback.
  • rollForward: "latestFeature": use
자주 묻는 질문

되돌리려면 어떻게 하나요?

로컬 SDK 폴더를 삭제하면 격리된 설치가 제거됩니다.

더 최신 .NET이 이미 설치되어 있어야 하나요?

네. global.json 경로 기능은 호스트에 .NET 10 이상 SDK가 필요합니다.

런타임만 설치하나요?

아니요. SDK 설치에 적용되므로, 런타임만 있는 설정에는 다른 방법이 필요합니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
5.8k
순위
#14654
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬