dotnet / dotnet/sdk

Reconsider global.json sdk.paths precedence for dotnetup init root

Open
#55,650 2 comments 1 reaction 2 assignees Claimed by @marcpopMSFT View on GitHub
Area-dotnetup
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

### Description

During `dotnetup init`, `InstallPathResolver` currently gives the first `sdk.paths` entry from the nearest `global.json` precedence over the default dotnetup install root when `--install-path` is not specified. This means running init from inside a repository can select a repository-specific SDK lookup path as the managed dotnetup hive.

This behavior became visible while adding the setup summary in #55648. That PR now identifies when the displayed install root was inferred from `global.json`, but changing the precedence is intentionally out of scope there.

### Current precedence

1. Explicit `--install-path`
2. First `sdk.paths` entry from `global.json`
3. Default dotnetup install root

### Follow-up

Decide whether first-run/init should ignore `global.json` `sdk.paths` when choosing the default managed hive, while preserving the intended behavior for explicit SDK install operations.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.