From d2a58ec4f0f01f4c622e0bd99d971ce7fa6d377e Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Tue, 28 Apr 2026 19:00:01 +0000
Subject: [PATCH 1/3] Fix runtime install dir to respect
DOTNET_GLOBAL_INSTALL_DIR
Agent-Logs-Url: https://github.com/dotnet/arcade/sessions/7ccc9cec-d18e-45be-96e3-4227afc36a1e
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
---
.../toolset/InstallDotNetCore.targets | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/Microsoft.DotNet.Arcade.Sdk/toolset/InstallDotNetCore.targets b/src/Microsoft.DotNet.Arcade.Sdk/toolset/InstallDotNetCore.targets
index 27bccaf4b26..3387f5820c4 100644
--- a/src/Microsoft.DotNet.Arcade.Sdk/toolset/InstallDotNetCore.targets
+++ b/src/Microsoft.DotNet.Arcade.Sdk/toolset/InstallDotNetCore.targets
@@ -9,10 +9,15 @@
+
+ <_DotNetPath Condition="'$(DOTNET_INSTALL_DIR)' != ''">$(DOTNET_INSTALL_DIR)
+ <_DotNetPath Condition="'$(_DotNetPath)' == ''">$(RepoRoot).dotnet
+
+
Date: Tue, 28 Apr 2026 19:35:15 +0000
Subject: [PATCH 2/3] Use DOTNET_GLOBAL_INSTALL_DIR instead of
DOTNET_INSTALL_DIR for runtime install path
Agent-Logs-Url: https://github.com/dotnet/arcade/sessions/834bab13-74c2-4704-be4e-c66f62f68e0f
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
---
.../toolset/InstallDotNetCore.targets | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Microsoft.DotNet.Arcade.Sdk/toolset/InstallDotNetCore.targets b/src/Microsoft.DotNet.Arcade.Sdk/toolset/InstallDotNetCore.targets
index 3387f5820c4..545b120fef5 100644
--- a/src/Microsoft.DotNet.Arcade.Sdk/toolset/InstallDotNetCore.targets
+++ b/src/Microsoft.DotNet.Arcade.Sdk/toolset/InstallDotNetCore.targets
@@ -10,7 +10,7 @@
- <_DotNetPath Condition="'$(DOTNET_INSTALL_DIR)' != ''">$(DOTNET_INSTALL_DIR)
+ <_DotNetPath Condition="'$(DOTNET_GLOBAL_INSTALL_DIR)' != ''">$(DOTNET_GLOBAL_INSTALL_DIR)
<_DotNetPath Condition="'$(_DotNetPath)' == ''">$(RepoRoot).dotnet
From 0a5c28f7208223fa9128d1f46e06f23689a08e53 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Tue, 28 Apr 2026 20:05:38 +0000
Subject: [PATCH 3/3] Respect DOTNET_GLOBAL_INSTALL_DIR in
eng/common/dotnet-install wrappers
Agent-Logs-Url: https://github.com/dotnet/arcade/sessions/117b7ac1-f8f4-41b0-b21a-f62e8c7d5b19
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
---
eng/common/dotnet-install.ps1 | 6 +++++-
eng/common/dotnet-install.sh | 6 +++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/eng/common/dotnet-install.ps1 b/eng/common/dotnet-install.ps1
index 811f0f717f7..50ae6273768 100644
--- a/eng/common/dotnet-install.ps1
+++ b/eng/common/dotnet-install.ps1
@@ -10,7 +10,11 @@ Param(
. $PSScriptRoot\tools.ps1
-$dotnetRoot = Join-Path $RepoRoot '.dotnet'
+if (-not [string]::IsNullOrEmpty($env:DOTNET_GLOBAL_INSTALL_DIR)) {
+ $dotnetRoot = $env:DOTNET_GLOBAL_INSTALL_DIR
+} else {
+ $dotnetRoot = Join-Path $RepoRoot '.dotnet'
+}
$installdir = $dotnetRoot
try {
diff --git a/eng/common/dotnet-install.sh b/eng/common/dotnet-install.sh
index 61f302bb677..1cb3f5abac2 100755
--- a/eng/common/dotnet-install.sh
+++ b/eng/common/dotnet-install.sh
@@ -80,7 +80,11 @@ case $cpuname in
;;
esac
-dotnetRoot="${repo_root}.dotnet"
+if [[ -n "${DOTNET_GLOBAL_INSTALL_DIR:-}" ]]; then
+ dotnetRoot="$DOTNET_GLOBAL_INSTALL_DIR"
+else
+ dotnetRoot="${repo_root}.dotnet"
+fi
if [[ $architecture != "" ]] && [[ $architecture != $buildarch ]]; then
dotnetRoot="$dotnetRoot/$architecture"
fi