I'm facing an issue where the pipeline is unable to retrieve the .NET SDK from the cache but instead downloads it on every build.
I'm currently using a Microsoft-hosted agent in Azure DevOps.
- task: UseDotNet@2
displayName: 'Get .net core 6'
inputs:
packageType: 'sdk'
version: '6.0.x'
installationPath: $(Agent.ToolsDirectory)/dotnet
Am I missing anything in my yml file?
The agent assigned to your build is restored to original state. So even if you install something there and afterward you will get the same agent it would be clear machine.
There is no way to keep something on Microsoft Hosted agents. For that purpose you should use Self hosted agents.