question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UseDotNet@2 doesn't use cache for 3.0.x

See original GitHub issue

Required Information

Entering this information will route you directly to the right team and expedite traction.

Question, Bug, or Feature?
Type: Bug

Environment

  • Server - Azure Pipelines

  • Agent - Hosted

    • If using Hosted agent, provide agent queue name:
    pool:
      vmImage: 'windows-2019'

Issue Description

As I understand this task should use already installed version of .net core sdk

      - task: UseDotNet@2
        inputs:
          packageType: sdk
          version: 3.0.x
        displayName: dotnet install

But currently it downloads and installs it

Task logs

Agent info:

2019-11-05T17:17:13.4102639Z ##[section]Starting: Initialize job
2019-11-05T17:17:13.4102908Z Agent name: 'Azure Pipelines 5'
2019-11-05T17:17:13.4102968Z Agent machine name: 'fv-az674'
2019-11-05T17:17:13.4103008Z Current agent version: '2.160.0'
2019-11-05T17:17:13.4103810Z Current image version: '20191009.1'
2019-11-05T17:17:13.4114021Z Agent running as: 'VssAdministrator'
2019-11-05T17:17:13.4207208Z Prepare build directory.
2019-11-05T17:17:13.4504343Z Set build variables.
2019-11-05T17:17:13.4547340Z Download all required tasks.
2019-11-05T17:17:13.4705287Z Downloading task: NuGetAuthenticate (0.159.0)
2019-11-05T17:17:14.3993388Z Downloading task: PowerShell (2.151.2)
2019-11-05T17:17:14.5699825Z Downloading task: UseDotNet (2.0.21)
2019-11-05T17:17:15.7963497Z Downloading task: CmdLine (2.151.2)
2019-11-05T17:17:16.0071326Z Downloading task: DotNetCoreCLI (2.158.1)
2019-11-05T17:17:17.8368952Z Downloading task: PublishCodeCoverageResults (1.160.1)
2019-11-05T17:17:19.3386608Z Downloading task: BuildQualityChecks (6.1.2)
2019-11-05T17:17:20.1125380Z Downloading task: CopyFiles (2.158.0)
2019-11-05T17:17:20.2394795Z Downloading task: PublishBuildArtifacts (1.158.1)
2019-11-05T17:17:20.5525103Z Start tracking orphan processes.
2019-11-05T17:17:20.5593318Z ##[section]Finishing: Initialize job

Task logs:

2019-11-05T17:18:23.2202009Z ##[section]Starting: dotnet install
2019-11-05T17:18:23.2332975Z ==============================================================================
2019-11-05T17:18:23.2333044Z Task         : Use .NET Core
2019-11-05T17:18:23.2333078Z Description  : Acquires a specific version of the .NET Core SDK from the internet or the local cache and adds it to the PATH. Use this task to change the version of .NET Core used in subsequent tasks. Additionally provides proxy support.
2019-11-05T17:18:23.2333128Z Version      : 2.0.21
2019-11-05T17:18:23.2333179Z Author       : Microsoft Corporation
2019-11-05T17:18:23.2333215Z Help         : https://aka.ms/AA4xgy0
2019-11-05T17:18:23.2333248Z ==============================================================================
2019-11-05T17:18:23.7487315Z Tool to install: .NET Core sdk version 3.0.x.
2019-11-05T17:18:45.6052421Z Found version 3.0.100 in channel 3.0 for user specified version spec: 3.0.x
2019-11-05T17:18:45.6661806Z Version 3.0.100 was not found in cache.
2019-11-05T17:18:45.6661882Z Getting URL to download .NET Core sdk version: 3.0.100.
2019-11-05T17:18:45.6661930Z Detecting OS platform to find correct download package for the OS.
2019-11-05T17:18:45.6662602Z [command]C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "& 'd:\a\_tasks\UseDotNet_b0ce7256-7898-45d3-9cb5-176b752bfea6\2.0.21\externals\get-os-platform.ps1'"
2019-11-05T17:18:46.1093745Z Primary:win-x64
2019-11-05T17:18:46.1094529Z Detected platform (Primary): win-x64
2019-11-05T17:18:46.1135713Z Downloading: https://download.visualstudio.microsoft.com/download/pr/a24f4f34-ada1-433a-a437-5bc85fc2576a/7e886d06729949c15c96fe7e70faa8ae/dotnet-sdk-3.0.100-win-x64.zip
2019-11-05T17:18:47.7659550Z Extracting downloaded package d:\a\_temp\2a609ffc-8f15-470f-bf4c-d45cadc31116.
2019-11-05T17:18:47.7665199Z Extracting archive
2019-11-05T17:18:47.7704841Z [command]C:\windows\system32\chcp.com 65001
2019-11-05T17:18:47.7813045Z Active code page: 65001
2019-11-05T17:18:47.8269339Z [command]C:\windows\System32\WindowsPowerShell\v1.0\powershell.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\_temp\2a609ffc-8f15-470f-bf4c-d45cadc31116', 'd:\a\_temp\bc59')"
2019-11-05T17:19:10.0497417Z Successfully installed .NET Core sdk version 3.0.100.
2019-11-05T17:19:10.0511676Z Creating global tool path and pre-pending to PATH.
2019-11-05T17:19:10.0645378Z ##[section]Finishing: dotnet install

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bishal-pdMSFTcommented, Nov 12, 2019

@IvanAlekseev do you mean that the task should not install the SDK if is installed anywhere (for example C:\ProgramFiles\dotnet) on the machine?

0reactions
vinodkumar3commented, Nov 13, 2019

Closing this. Please refer this issue to track progress.

Read more comments on GitHub >

github_iconTop Results From Across the Web

UseDotNet@2 - Use dotnet v2 task - Microsoft Learn
Use this task to acquire a specific version of the .NET Core SDK from the internet or the local cache and add it...
Read more >
UseDotNet@2 seemingly installs the runtime but not available ...
I have an Azure Pipeline that is supposed to build my Open Source library CacheCow on github. This was fine for a few...
Read more >
Get UseDotNet@2 in Azure DevOps to use the vmImage's ...
x version of dotnet. So, I would presume the step would see that the software is already available and not do anything. Instead,...
Read more >
SonarScanner does not support .NET 6.0 (LTS) sdk/runtime
NET version does not support net6.0 and Azure DevOps build pipeline ... true - task: UseDotNet@2 displayName: 'Use runtime 3.x' inputs: ...
Read more >
How to Optimize .NET Pipelines in Azure DevOps ... - Tinkerer
NET Core sdk' inputs: version: 3.1.x - task: DotNetCoreCLI@2 displayName: ". ... As Azure doesn't allow us to selectively pull git LFS files...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found