Skip to content

Reinstall SDKs and runtimes when the dotnet host is missing - #742

Open
zjdangge wants to merge 1 commit into
dotnet:mainfrom
zjdangge:codex/reinstall-missing-dotnet-host
Open

zjdangge wants to merge 1 commit into
dotnet:mainfrom
zjdangge:codex/reinstall-missing-dotnet-host

Conversation

@zjdangge

Copy link
Copy Markdown

When a version directory exists but the dotnet executable is missing, the scripts report that the SDK or runtime is already installed and never restore the host. Require the host to be a file before taking the already-installed path in both PowerShell and Bash. Preserve Windows Desktop runtime installation, since that package does not include dotnet.exe.

Addresses the missing-host case in #552. The version-directory marker checks discussed in #694 remain a separate follow-up: repairing those files also requires changes to the extraction skip logic.

Adds package-detection tests for SDK, .NET runtime, and ASP.NET Core runtime installations with a missing host, a host file, or a same-named directory, plus the missing-version and Windows Desktop cases.

Validation:

  • Windows Debug build and 18 focused package-detection, script-encoding, and tar-extraction tests pass.
  • PowerShell and Git Bash detection checks reproduced 6 failures each on the original scripts and pass after the fix; Bash syntax and PowerShell parsing checks pass.
  • Installed the public ASP.NET Core 8.0.11 archive from a local feed, removed dotnet.exe, and retried. The original script reported already installed without restoring the host. The updated script restored it, including with -SkipNonVersionedFiles, and dotnet --list-runtimes succeeded.

The full download matrix and native Linux/macOS test runs were not executed locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant