From aa408e4b95db9e3bace4779dfe5afed1153ff06c Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Fri, 14 Feb 2025 18:17:33 +0000 Subject: [PATCH] Add default .NET install path for SDK validation --- .pipelines/templates/release-validate-sdk.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.pipelines/templates/release-validate-sdk.yml b/.pipelines/templates/release-validate-sdk.yml index 781c9bcdf67..d672792132b 100644 --- a/.pipelines/templates/release-validate-sdk.yml +++ b/.pipelines/templates/release-validate-sdk.yml @@ -87,7 +87,16 @@ jobs: Get-Content $nugetPath # Add workaround to unblock xUnit testing see issue: https://github.com/dotnet/sdk/issues/26462 - $dotnetPath = if ($IsWindows) { "$env:LocalAppData\Microsoft\dotnet" } else { "$env:HOME/.dotnet" } + + $possibleDotnetLocation = "$env:ProgramFiles\dotnet" + + $dotnetPath = if ($IsWindows) { + if (Test-Path $possibleDotnetLocation) { $possibleDotnetLocation } else { "$env:LocalAppData\Microsoft\dotnet" } + } + else { + "$env:HOME/.dotnet" + } + $env:DOTNET_ROOT = $dotnetPath dotnet --info