microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.5k stars 2.61k forks source link

[BUG]: UseDotNetV2 does not use pre-installed versions #19019

Open mikeharder opened 1 year ago

mikeharder commented 1 year ago

Task name

UseDotNetV2

Task version

2.228.0

Environment type (Please select at least one enviroment where you face this issue)

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

All

Task log

# YML
steps:
  - script: dotnet --info

  - task: UseDotNet@2
    inputs:
      version: 6.x

  - task: UseDotNet@2
    inputs:
      version: 7.x

Relevant log output

# Output
$ dotnet --info
.NET SDKs installed:
  6.0.414 [/usr/share/dotnet/sdk]
  7.0.111 [/usr/share/dotnet/sdk]
  7.0.203 [/usr/share/dotnet/sdk]
  7.0.308 [/usr/share/dotnet/sdk]
  7.0.401 [/usr/share/dotnet/sdk]

Tool to install: .NET Core sdk version 6.x.
Found version 6.0.414 in channel 6.0 for user specified version spec: 6.x
get-os-distro: Error: Distribution specific OS name and version could not be detected: UName = Linux
Version 6.0.414 was not found in cache.

Tool to install: .NET Core sdk version 7.x.
Found version 7.0.401 in channel 7.0 for user specified version spec: 7.x
get-os-distro: Error: Distribution specific OS name and version could not be detected: UName = Linux
Version 7.0.401 was not found in cache.

Aditional info

Command `dotnet --info` confirms the requested versions are installed, but the task is not installing them.

Related: https://github.com/actions/runner-images/issues/8387

github-actions[bot] commented 6 months ago

This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days

Frulfump commented 6 months ago

Still an issue. PR that potentially fixes this issue #19415. Also this issue is probably a duplicate of #15020

sanan-wow commented 6 months ago

Still an issue and we hope this can get fixed too. Our pipelines intermittently fail while this task is trying to download dotnet 6, while build agents already have dotnet 6. This task needs and if else condition to check the local pre-installed version and use them instead of trying to download and fail.