Provide more info about how apphost is built to user in vs code and only wait a few seconds to get c# dev kit build task#12659
Merged
adamint merged 6 commits intodotnet:mainfrom Nov 4, 2025
Conversation
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12659Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12659" |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the .NET project build logic in the VS Code extension to handle C# Dev Kit availability more gracefully. The key change replaces the p-retry library with a simpler time-based retry loop and always falls back to dotnet CLI when Dev Kit tasks are unavailable.
- Removes dependency on the p-retry library, replacing it with a simple time-based polling loop
- Refactors build logic to always fall back to dotnet CLI instead of failing when C# Dev Kit build tasks aren't found
- Adds informative console messages to indicate build method being used
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| extension/src/debugger/languages/dotnet.ts | Refactored buildDotNetProject to use time-based polling instead of p-retry, restructured to always fall back to dotnet CLI, removed unused import |
| extension/src/loc/strings.ts | Added two new localized strings for build status messages, updated noCsharpBuildTask message |
| extension/package.nls.json | Updated localization strings to match strings.ts changes |
| extension/package.json | Removed p-retry dependency |
| extension/loc/xlf/aspire-vscode.xlf | Updated XLF localization file with new strings |
eerhardt
reviewed
Nov 4, 2025
eerhardt
reviewed
Nov 4, 2025
eerhardt
approved these changes
Nov 4, 2025
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
C# dev kit only registers build tasks after workspaces are loaded. It is possible that workspace load takes a significant amount of time, upwards of a minute for large solutions like Aspire.
Currently, the vs code extension waits close to a minute to acquire the build task (if C# dev kit is installed). I have changed this to fetch tasks only once so that users are not frustrated by delays. If it is not installed, no information message was displayed to indicate that the dotnet CLI was going to be used to build the apphost. I have changed this to send a message to the debug console when the build task is not found or when dev kit is not installed.
ex (when c# dev kit is not installed)

p-retry is no longer necessary so I removed it.
Checklist
<remarks />and<code />elements on your triple slash comments?doc-ideatemplatebreaking-changetemplatediagnostictemplate