Skip to content

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
adamint:dev/adamint/limit-time-for-devkit-build-task-retrieval
Nov 4, 2025
Merged

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
adamint merged 6 commits intodotnet:mainfrom
adamint:dev/adamint/limit-time-for-devkit-build-task-retrieval

Conversation

@adamint
Copy link
Member

@adamint adamint commented Nov 4, 2025

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)
image

p-retry is no longer necessary so I removed it.

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2025

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12659

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12659"

@adamint adamint changed the title Provide more info about how apphost is built to user in vs code 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 Nov 4, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

adamint and others added 4 commits November 4, 2025 11:24
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@adamint adamint enabled auto-merge (squash) November 4, 2025 17:06
@adamint adamint merged commit c30abdc into dotnet:main Nov 4, 2025
296 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the 13.1 milestone Nov 4, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Dec 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants