Skip to content

[docs] Update aspire cache clear docs with staging NuGet package cache - #1108

Closed
aspire-repo-bot[bot] wants to merge 1 commit into
release/13.4from
docs/pr-17573-aspire-cache-clear-staging-f0c7730b242a5a22
Closed

aspire-repo-bot[bot] wants to merge 1 commit into
release/13.4from
docs/pr-17573-aspire-cache-clear-staging-f0c7730b242a5a22

Conversation

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Documents changes from microsoft/aspire#17573

Authored by @danegsta.

Targeting release/13.4 based on the source PR milestone 13.4 (exact match).

Why this PR is needed

The aspire cache clear command was extended in microsoft/aspire#17573 to also wipe staging-channel NuGet package caches stored under <ASPIRE_HOME>/.nugetpackages/. These per-build caches (keyed by a short hash of the staging feed URL) can become stale and cause assembly-loading failures in polyglot AppHosts using a stable-shaped staging CLI build. Running aspire cache clear is now the supported recovery path — no manual filesystem surgery required.

The existing docs described what the command clears but did not mention the staging NuGet package caches. This PR fills that gap.

Changes

  • Updated aspire-cache-clear.mdx:
    • Extended the Description paragraph to mention staging NuGet package caches
    • Added Staging NuGet package caches to the "What gets cleared" bullet list, with the path <ASPIRE_HOME>/.nugetpackages/
    • Added a When to clear cache section with a staging-specific bullet explaining that clearing recovers wedged staging restores

Files modified

  • src/frontend/src/content/docs/reference/cli/commands/aspire-cache-clear.mdx (updated)

Generated by PR Documentation Check for issue #17573 · ● 16.2M · ◷

aspire cache clear now also removes staging channel NuGet package
caches stored under <ASPIRE_HOME>/.nugetpackages/. These per-build
caches are keyed by the staging feed URL hash and can become wedged,
causing assembly loading failures. Running aspire cache clear is now
the supported recovery path.

Documents changes from microsoft/aspire#17573.

Co-authored-by: Copilot <[email protected]>
@aspire-repo-bot aspire-repo-bot Bot added the docs-from-code Copilot initiated issue from dotnet/aspire repo label May 28, 2026
@IEvangelist
David Pine (IEvangelist) marked this pull request as ready for review May 28, 2026 04:54
Copilot AI review requested due to automatic review settings May 28, 2026 04:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates the aspire cache clear CLI reference documentation to include staging-channel NuGet package caches as part of the data cleared by the command.

Changes:

  • Mentions staging NuGet package caches in the command description.
  • Adds staging package caches to the “What gets cleared” list.
  • Adds a “When to clear cache” section with staging restore guidance.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Downloaded project templates
- NuGet package metadata and search results
- Integration package information
- Staging NuGet package caches (per-build caches under `<ASPIRE_HOME>/.nugetpackages/`)

@IEvangelist David Pine (IEvangelist) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Docs accuracy review

Source of truth: microsoft/aspire@cc4b7eaf (release/13.4, fetched 2026-05-29)
PR head: 8845906ebba760deff69b3dcccc2c826d19554d9

Verdict Count
verified 3
verified-with-nuance 1
unverifiable 0
contradicted 0

Verdict: COMMENT. Cache location and the wedged-staging-restore remediation are exact. One small framing nuance: the per-staging-build subdirectories are actually keyed by feed-URL hash, not by build id; in practice each staging build has its own feed URL so the user-visible behavior is equivalent.

Doc-tester (UX) notes

A user hitting a wedged staging restore will find this page and get the right remedy — aspire cache clear removes everything under <ASPIRE_HOME>/.nugetpackages/, which is exactly what the source comment is built to fix. The "When to clear cache" bullet that mentions the wedged-staging case is a useful entry point.

Verified claims (with evidence)
# Claim Evidence
1 "aspire cache clear ... includes ... staging NuGet package caches." src/Aspire.Cli/Commands/CacheCommand.cs:43-50 — the ClearCommand execution deletes the parent of GetStagingNuGetPackagesDirectory(...) ( _.../.nugetpackages/) so all SHA-keyed subdirectories are wiped. Comment block (:43-48) calls out the staging-specific intent and the <ASPIRE_HOME>/.nugetpackages/ path.
2 "<ASPIRE_HOME>/.nugetpackages/" src/Aspire.Cli/Utils/CliPathHelper.cs:26 internal const string StagingNuGetPackagesFolderName = ".nugetpackages"; and :70-74 GetStagingNuGetPackagesDirectory returns Path.Combine(aspireHomeDirectory.FullName, StagingNuGetPackagesFolderName).
3 "can recover from a wedged staging restore without manual filesystem intervention." CacheCommand.cs:43-48 comment reads: "clearing them lets users recover wedged staging restores without filesystem surgery." Same intent, slightly different phrasing.
Verified-with-nuance
# Claim Nuance
4 "per-build NuGet package cache" / "per-build caches under <ASPIRE_HOME>/.nugetpackages/" CliPathHelper.cs:76-108 ComputeStagingFeedCacheKey keys on the feed URL (XxHash3, lower-cased, trimmed), not on the build id directly: "Keying on the feed URL (rather than the CLI commit SHA) means that the same CLI talking to two different override staging feeds gets two distinct caches." Each staging build does in practice expose a unique feed URL, so the user-visible "one cache per build" framing holds, but the literal implementation is "one cache per feed URL hash". Worth noting in case a reader is hunting for <sha> style directory names by build id rather than feed hash.

@davidfowl

Copy link
Copy Markdown
Contributor

Does not need to be documented.

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

Labels

docs-from-code Copilot initiated issue from dotnet/aspire repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants