-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Install .NET 6.0.x
runtime. Remove DotNetCoreVersion
param. Undo DOTNET_ROLL_FORWARD
.
#5395
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,25 @@ | ||
parameters: | ||
# Use this parameter if you want to override the .NET SDK set by global.json | ||
- name: DotNetCoreVersion | ||
type: string | ||
default: '' | ||
|
||
steps: | ||
# We set DOTNET_ROLL_FORWARD so that .NET assemblies targeting older versions of .NET can run on newer ones. | ||
# See also: | ||
# https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet#options-for-running-an-application | ||
# https://learn.microsoft.com/en-us/dotnet/core/runtime-discovery/troubleshoot-app-launch?pivots=os-windows#required-framework-not-found | ||
# https://aka.ms/dotnet/app-launch-failed | ||
# https://learn.microsoft.com/en-us/azure/devops/pipelines/scripts/logging-commands?view=azure-devops&tabs=powershell | ||
# https://learn.microsoft.com/en-us/azure/devops/pipelines/process/set-variables-scripts?view=azure-devops&tabs=powershell | ||
- pwsh: | | ||
echo "##vso[task.setvariable variable=DOTNET_ROLL_FORWARD;]Major" | ||
displayName: "Set DOTNET_ROLL_FORWARD to Major" | ||
# https://learn.microsoft.com/azure/devops/pipelines/tasks/reference/use-dotnet-v2?view=azure-pipelines | ||
|
||
# We aim to keep .NET SDK coming from global.json to bethe newest, to enable us to use the latest & greatest, | ||
# and allow us to gradually migrate our .NET sources to such version. | ||
# About global.json: https://learn.microsoft.com/en-us/dotnet/core/tools/global-json | ||
- task: UseDotNet@2 # About UseDotNet@2 task: https://learn.microsoft.com/azure/devops/pipelines/tasks/reference/use-dotnet-v2?view=azure-pipelines | ||
displayName: "Use .NET SDK from global.json" | ||
retryCountOnTaskFailure: 3 | ||
inputs: | ||
useGlobalJson: true | ||
|
||
# We install .NET 6.0.x runtime in addition to .NET coming from global.json because most of our tools target 6.0.x. | ||
# Once we migrate all tools to a newer .NET version, we should update this to install that version instead. | ||
- task: UseDotNet@2 | ||
displayName: "Use .NET SDK ${{ coalesce( parameters.DotNetCoreVersion, 'from global.json') }}" | ||
displayName: "Use .NET runtime 6.0.x" | ||
retryCountOnTaskFailure: 3 | ||
inputs: | ||
${{ if eq( parameters.DotNetCoreVersion, '') }}: | ||
useGlobalJson: true | ||
${{ else }}: | ||
version: ${{ parameters.DotNetCoreVersion }} | ||
packageType: runtime | ||
version: 6.0.x | ||
# performMultiLevelLookup comes into play when given .NET executable target runtime is different | ||
# than the installed .NET SDK. Without this, such runtime would not be found. | ||
performMultiLevelLookup: true | ||
|
||
# Future work: add NuGet packages caching. See: | ||
# https://github.com/Azure/azure-sdk-tools/issues/5086 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was expecting to see this on the SDK install above. Did you try to verify if we need to explicitly have this step for the 6 runtime?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per our chat, these builds show the behavior on
performMultiLevelLookup
for SDK:(source)
For 6.0 target (fails):
For 7.0 target (works):