`dotnetup` does not correctly detect SDK version from `global.json`
- Dominant language
- C#
- Stars
- 3.2k
- Forks
- 1.3k
- PR merge metrics
- PR metrics pending
Description
### Prerequisites
- [x] I have read the [dotnetup documentation](https://github.com/dotnet/sdk/tree/release/dnup/documentation/general/dotnetup).
- [x] I have searched for [existing dotnetup issues](https://github.com/dotnet/sdk/issues?q=is%3Aissue%20state%3Aopen%20label%3Adotnetup).
- [x] I have searched for [existing dotnetup discussions](https://github.com/dotnet/sdk/discussions/categories/dotnetup).
### Issue type
Bug report
### Description
The global.json file in https://github.com/dotnet/docker-tools requires a daily SDK. When running `dotnetup install` in the repo, it detects a "latest" channel instead. See output below:
```
PS D:\s\dotnet\docker-tools> cat global.json
{
"sdk": {
"version": "11.0.100-preview.5.26227.104",
"rollForward": "latestMajor",
"allowPrerelease": true
},
"tools": {
"dotnet": "11.0.100-preview.5.26227.104",
"runtimes": {
"dotnet": [
"9.0.11",
"10.0.1"
]
}
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "11.0.0-beta.26279.5"
}
}
PS D:\s\dotnet\docker-tools> dotnetup install
.NET SDK latest will be installed since D:\s\dotnet\docker-tools\global.json specifies that version.
Installing .NET SDK 10.0.301 to C:\Users\...\AppData\Local\dotnet...
Already installed at C:\Users\...\AppData\Local\dotnet:
.NET SDK 10.0.301
```
Environment info: Windows 11, PowerShell 7.6.3.
### dotnetup version
0.1.4-preview.6.26316.3+959e393d619d6ec339be99d8b8c7ed598fb935c6
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing `dotnetup install` in a repository containing the shown `global.json`, focusing on how dotnetup reads the `sdk.version` value and classifies its channel. Check the dotnetup implementation and any existing tests for global.json version detection. Done means the daily SDK version is detected instead of the `latest` channel and the behavior is covered by a test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100