Make .NET SDK check in aspire doctor based on apphost language#15018
Open
davidfowl wants to merge 2 commits intorelease/13.2from
Open
Make .NET SDK check in aspire doctor based on apphost language#15018davidfowl wants to merge 2 commits intorelease/13.2from
davidfowl wants to merge 2 commits intorelease/13.2from
Conversation
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15018Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15018" |
da619c1 to
38004f0
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Updates aspire doctor’s .NET SDK prerequisite check to be language-aware by attempting to locate the AppHost and skipping the SDK check when the AppHost is identified as non-.NET (polyglot) to avoid false failures in those scenarios.
Changes:
- Extend
DotNetSdkCheckto useIProjectLocator+ILanguageDiscoveryto detect a non-.NET AppHost and skip the SDK check. - Add unit tests covering “no apphost”, “non-.NET apphost”, “.NET apphost”, “multiple apphosts”, and “unknown language” behaviors.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Aspire.Cli/Utils/EnvironmentChecker/DotNetSdkCheck.cs | Adds AppHost discovery + language detection to decide whether to skip the .NET SDK check for polyglot scenarios. |
| tests/Aspire.Cli.Tests/Commands/DotNetSdkCheckTests.cs | Introduces unit coverage for the new skip/fallthrough behaviors. |
Update DotNetSdkCheck to detect the apphost project (same pattern as aspire run) and skip the .NET SDK check when the apphost is a non-.NET project (TypeScript, Python, Go, etc.). Fixes #14404 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
38004f0 to
c37813f
Compare
Contributor
🎬 CLI E2E Test RecordingsThe following terminal recordings are available for commit
📹 Recordings uploaded automatically from CI run #22780517245 |
Skip the .NET SDK check entirely when no settings.json is found or when the apphost is non-.NET. Previously the check would fall through and run whenever we couldn't determine the language. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Description
Make the .NET SDK check in
aspire doctoraware of the AppHost language. When the detected AppHost is a non-.NET project (TypeScript, Python, Go, etc.), the .NET SDK check is skipped since it's not required for polyglot scenarios.Uses the same
IProjectLocatorpattern asaspire runto find the AppHost, then checks its language viaILanguageDiscovery.GetLanguageByFile(). Falls through to the normal .NET SDK check when no AppHost is found, multiple are found, or the AppHost is a .NET project.Fixes #14404
Checklist
<remarks />and<code />elements on your triple slash comments?aspire.devissue: