setup-local-sdk

Installs a .NET SDK into a project-local .dotnet directory with global.json paths configuration.

Updated Jul 12, 2026
One-click install
npx skills add https://github.com/Patrick-Rex/DotNetTechSamples --skill setup-local-sdk-patrick-rex
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: setup-local-sdk
Source: https://github.com/Patrick-Rex/DotNetTechSamples/tree/main/.agents/plugins/dotnet/skills/setup-local-sdk
Command: npx skills add https://github.com/Patrick-Rex/DotNetTechSamples --skill setup-local-sdk-patrick-rex

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Testing preview .NET SDKs or pinning exact SDK versions normally requires modifying the system-wide installation, which risks breaking other projects. This Skill installs a .NET SDK into a project-local .dotnet/ directory and wires it up via the global.json paths feature (.NET 10+), leaving the system installation untouched. ## Core Features & Use Cases - Isolated SDK Installation: Downloads and installs any .NET SDK channel, quality, or exact version into .dotnet/ using the official dotnet-install scripts on macOS, Linux, or Windows. - Automatic SDK Resolution: Creates or merges global.json with paths: [".dotnet", "$host$"], roll-forward policy, and prerelease settings so dotnet commands pick up the local SDK automatically. - Team Reproducibility: Generates install-dotnet.sh and install-dotnet.ps1 scripts, updates .gitignore, and optionally installs workloads like MAUI using the local dotnet binary. - Use Case: You want to try the latest .NET 11 preview without touching your stable system SDK. The Skill installs it locally, configures global.json, and verifies dotnet --version resolves to the preview build. ## Quick Start Ask the assistant to install the latest .NET 11 preview SDK locally for this project without changing the system-wide installation.

Frequently Asked Questions about setup-local-sdk

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I install a .NET preview SDK without affecting my system installation?

Use the dotnet-install script with --install-dir .dotnet to place the SDK in a project-local folder, then add a global.json with paths set to [".dotnet", "$host$"]. The dotnet host resolves the local SDK first, and deleting .dotnet reverts everything.

How to pin an exact .NET SDK version for a team project?

Install the exact version with --version instead of channel flags, then set that version in global.json with rollForward set to disable. Commit the generated install-dotnet.sh and install-dotnet.ps1 scripts so teammates reproduce the same SDK.

Does the global.json paths feature work with older .NET versions?

No, the paths feature requires a .NET 10 or later host SDK installed system-wide. On older hosts the paths array is ignored, so you must install .NET 10+ globally first before using local SDK resolution.

Why are my MAUI workloads missing after installing a local .NET SDK?

Workloads were likely installed with the system dotnet instead of the local binary. Workload metadata is stored relative to the host process's dotnet root, so always run ./.dotnet/dotnet workload install to register them with the local SDK.

Can I use a local .NET SDK for runtime-only installs?

No, the global.json paths feature applies only to SDK resolution, not runtime or apphost resolution. For runtime-only scenarios use dotnet run or set the DOTNET_ROOT environment variable instead.