Get UseDotNet 2 in Azure DevOps to use the vmImage s dotnet SDK or one from a cache

0 votes

I have an Azure DevOps pipeline with an agent and step like this:

pool:
  vmImage: 'windows-latest'

# ....

steps:
- task: UseDotNet@2
  inputs:
    packageType: 'sdk'
    version: '5.x'

The step takes 25 seconds to do download. Here's the output from Azure DevOps:

2022-03-31T09:32:37.5205829Z ##[section]Starting: UseDotNet
2022-03-31T09:32:37.5326189Z ==============================================================================
2022-03-31T09:32:37.5326523Z Task         : Use .NET Core
2022-03-31T09:32:37.5327080Z 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.
2022-03-31T09:32:37.5327618Z Version      : 2.198.0
2022-03-31T09:32:37.5327838Z Author       : Microsoft Corporation
2022-03-31T09:32:37.5328057Z Help         : https://aka.ms/AA4xgy0
2022-03-31T09:32:37.5328346Z ==============================================================================
2022-03-31T09:32:38.1175143Z Tool to install: .NET Core sdk version 5.x.
2022-03-31T09:32:40.3450298Z Found version 5.0.406 in channel 5.0 for user specified version spec: 5.x
2022-03-31T09:32:40.3901604Z Version 5.0.406 was not found in cache.
2022-03-31T09:32:40.3902218Z Getting URL to download .NET Core sdk version: 5.0.406.
2022-03-31T09:32:40.3903044Z Detecting OS platform to find correct download package for the OS.
2022-03-31T09:32:40.3919001Z [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.198.0\externals\get-os-platform.ps1'"
2022-03-31T09:32:40.7335953Z Primary:win-x64
2022-03-31T09:32:40.7337064Z Detected platform (Primary): win-x64
2022-03-31T09:32:40.7357212Z Downloading: https://download.visualstudio.microsoft.com/download/pr/aa30e704-a085-4ed4-bcbd-9f3491b7722b/05a1aefc5c841a1faa7eae08a5cec110/dotnet-sdk-5.0.406-win-x64.zip
2022-03-31T09:32:42.0180110Z Extracting downloaded package D:\a\_temp\33032e6d-ebd8-4f81-951e-779d5384477e.
2022-03-31T09:32:42.0188915Z Extracting archive
2022-03-31T09:32:42.0229477Z [command]C:\Windows\system32\chcp.com 65001
2022-03-31T09:32:42.0330177Z Active code page: 65001
2022-03-31T09:32:42.0554435Z [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\33032e6d-ebd8-4f81-951e-779d5384477e', 'D:\a\_temp\99ba')"
2022-03-31T09:33:02.8364659Z Successfully installed .NET Core sdk version 5.0.406.
2022-03-31T09:33:02.8381246Z Creating global tool path and pre-pending to PATH.
2022-03-31T09:33:02.8488020Z ##[section]Finishing: UseDotNet


How can I know that my dotnet SDK is being grabbed from the vmImage's installed software or some kind of cache? 

Apr 19, 2022 in Other DevOps Questions by Kichu
• 19,040 points
821 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Other DevOps Questions

+1 vote
2 answers

When do we use Chef or Azure SDK to create VM and deploy in automation

The solution to the automated deployment in ...READ MORE

answered Aug 21, 2018 in Other DevOps Questions by Priyaj
• 58,020 points
1,142 views
0 votes
0 answers
0 votes
0 answers
0 votes
0 answers

Basic Azure DevOps flow for ASP .Net

I have a custom build script and ...READ MORE

Apr 20, 2022 in Other DevOps Questions by Kichu
• 19,040 points
507 views
0 votes
0 answers
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP