Repository navigation
Flow DotNetPath through to dotnet-install scripts - #17097
Merged
ViktorHofer merged 1 commit intoJul 10, 2026
Merged
ViktorHofer merged 1 commit into
ViktorHofer merged 1 commit into
Conversation
The InstallDotNetCore task resolves a DotNetPath but only used it for the local 'already installed' check. The dotnet-install.ps1/.sh scripts recomputed the install root themselves. Expose a -dotnetPath parameter in both scripts and pass the task's resolved DotNetPath through so the install location is consistent. Co-authored-by: Copilot <[email protected]> Copilot-Session: 3875be5f-869d-42d5-a70f-df6757114b05
akoeplinger
approved these changes
Jul 10, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR ensures the InstallDotNetCore MSBuild task’s resolved DotNetPath (install root) is actually honored by the dotnet-install wrapper scripts, instead of those scripts independently recomputing the root from DOTNET_GLOBAL_INSTALL_DIR / $(RepoRoot).dotnet.
Changes:
- Adds a
-dotnetPathparameter toeng/common/dotnet-install.ps1andeng/common/dotnet-install.shand makes it take precedence when selecting the install root. - Updates
InstallDotNetCore.csto pass the task’sDotNetPaththrough to the install scripts via-dotnetPath. - Preserves existing fallback behavior for direct script invocations (env-var /
.dotnet) when-dotnetPathisn’t provided.
Show a summary per file
| File | Description |
|---|---|
| src/Microsoft.DotNet.Arcade.Sdk/src/InstallDotNetCore.cs | Passes the task’s resolved install root through to the dotnet-install script invocation. |
| eng/common/dotnet-install.sh | Accepts -dotnetPath and uses it as the install root before falling back to existing defaults. |
| eng/common/dotnet-install.ps1 | Accepts -dotnetPath and uses it as the install root before falling back to existing defaults. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 0
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The
InstallDotNetCoreMSBuild task accepts aDotNetPathparameter, but only used it for the localalready installedcheck. Thedotnet-install.ps1/.shscripts recomputed the install root themselves fromDOTNET_GLOBAL_INSTALL_DIR/.dotnet, so the task's resolved path never flowed to the actual install invocation.This change:
-dotnetPathparameter in botheng/common/dotnet-install.ps1andeng/common/dotnet-install.sh. When set, it takes precedence over the env-var /.dotnetfallback when computing the install root (fallbacks preserved for direct script invocations).DotNetPaththrough via-dotnetPathinInstallDotNetCore.cs.Both scripts still append the architecture subfolder afterward, consistent with the task's
CheckRuntimeDotnetInstalledlogic.