I have a global.json
that looks like this:
{
"sdk": {
"version": "8.0.301",
"rollForward": "latestFeature"
}
}
This means, as far as I know, that I want it to accept 8.0.xxx
as long as it’s not lower than 8.0.301. For example, both 8.0.302
and 8.0.400
would work, but 8.1.x
or x.x.x
wouldn’t.
The problem is that my Azure Pipeline only wants to install 8.0.301
. At the time of writing, 8.0.302
is available, which is backed up by Microsoft’s official download page.
My Azure pipeline task that installs the .NET SDK is as follows:
- task: UseDotNet@2
displayName: "Install .NET SDK"
inputs:
packageType: sdk
useGlobalJson: true
But when this runs, I see the following logs:
Found version 8.0.301 in channel 8.0 for user specified version spec: 8.0.301
Getting URL to download .NET Core sdk version: 8.0.301.
Detecting OS platform to find correct download package for the OS.
C:WindowsSystem32WindowsPowerShellv1.0powershell.exe -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "& 'D:a_tasksUseDotNet_b0ce7256-7898-45d3-9cb5-176b752bfea62.238.1externalsget-os-platform.ps1'"
Primary:win-x64
Detected platform (Primary): win-x64
Version 8.0.301 was not found in cache.
Downloading: https://download.visualstudio.microsoft.com/download/pr/7ac2d880-2d57-4008-850e-4b42b829c354/e1c92cb3b6a85f53cab6fa55b14b49e3/dotnet-sdk-8.0.301-win-x64.zip
Extracting downloaded package D:a_temp7024317f-ea64-4710-afa8-0435e0f177ed.
Extracting archive
C:Windowssystem32chcp.com 65001
Active code page: 65001
C:WindowsSystem32WindowsPowerShellv1.0powershell.exe -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('D:a_temp7024317f-ea64-4710-afa8-0435e0f177ed', 'D:a_temp9404')"
Successfully installed .NET Core sdk version 8.0.301.
Creating global tool path and pre-pending to PATH.
Finishing: Install .NET SDK
Why would it install 8.0.301
even though 8.0.302
should get downloaded?
For more information: https://github.com/microsoft/azure-pipelines-tasks/issues/20065