1- parameters :
2- # Use this parameter if you want to override the .NET SDK set by global.json
3- - name : DotNetCoreVersion
4- type : string
5- default : ' '
6-
71steps :
8- # We set DOTNET_ROLL_FORWARD so that .NET assemblies targeting older versions of .NET can run on newer ones.
9- # See also:
10- # https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet#options-for-running-an-application
11- # https://learn.microsoft.com/en-us/dotnet/core/runtime-discovery/troubleshoot-app-launch?pivots=os-windows#required-framework-not-found
12- # https://aka.ms/dotnet/app-launch-failed
13- # https://learn.microsoft.com/en-us/azure/devops/pipelines/scripts/logging-commands?view=azure-devops&tabs=powershell
14- # https://learn.microsoft.com/en-us/azure/devops/pipelines/process/set-variables-scripts?view=azure-devops&tabs=powershell
15- - pwsh : |
16- echo "##vso[task.setvariable variable=DOTNET_ROLL_FORWARD;]Major"
17- displayName: "Set DOTNET_ROLL_FORWARD to Major"
18- # https://learn.microsoft.com/azure/devops/pipelines/tasks/reference/use-dotnet-v2?view=azure-pipelines
2+
3+ # We aim to keep .NET SDK coming from global.json to bethe newest, to enable us to use the latest & greatest,
4+ # and allow us to gradually migrate our .NET sources to such version.
5+ # About global.json: https://learn.microsoft.com/en-us/dotnet/core/tools/global-json
6+ - task : UseDotNet@2 # About UseDotNet@2 task: https://learn.microsoft.com/azure/devops/pipelines/tasks/reference/use-dotnet-v2?view=azure-pipelines
7+ displayName : " Use .NET SDK from global.json"
8+ retryCountOnTaskFailure : 3
9+ inputs :
10+ useGlobalJson : true
11+
12+ # We install .NET 6.0.x SDK in addition to .NET coming from global.json because most of our tools target 6.0.x.
13+ # Once we migrate all tools to a newer .NET version, we should update this to install that version instead.
1914 - task : UseDotNet@2
20- displayName : " Use .NET SDK ${{ coalesce( parameters.DotNetCoreVersion, 'from global.json') }} "
15+ displayName : " Use .NET SDK 6.0.x "
2116 retryCountOnTaskFailure : 3
2217 inputs :
23- ${{ if eq( parameters.DotNetCoreVersion, '') }} :
24- useGlobalJson : true
25- ${{ else }} :
26- version : ${{ parameters.DotNetCoreVersion }}
18+ # We must install sdk, not just runtime, as it is required by some of our tools, like test-proxy.
19+ # For additional context, see PR: https://github.com/Azure/azure-sdk-tools/pull/5405
20+ packageType : sdk
21+ version : 6.0.x
22+ # performMultiLevelLookup comes into play when given .NET executable target runtime is different
23+ # than the installed .NET SDK. Without this, such runtime would not be found.
24+ performMultiLevelLookup : true
2725
2826# Future work: add NuGet packages caching. See:
29- # https://github.com/Azure/azure-sdk-tools/issues/5086
27+ # https://github.com/Azure/azure-sdk-tools/issues/5086
0 commit comments