Fix the expected path of .NET after using UseDotnet 2 task to install (#25020)

This commit is contained in:
Aditya Patwardhan
2025-02-18 11:13:38 -06:00
committed by GitHub
parent b565679961
commit d62ff8a211
@@ -86,19 +86,6 @@ jobs:
Get-Content $nugetPath
# Add workaround to unblock xUnit testing see issue: https://github.com/dotnet/sdk/issues/26462
$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
dotnet restore
dotnet test /property:RELEASE_VERSION=$releaseVersion --test-adapter-path:. "--logger:xunit;LogFilePath=$(System.DefaultWorkingDirectory)/test-hosting.xml"