Repository navigation
Description
Is there an existing issue for this?
- I have searched the existing issues.
Describe the bug
On Windows, aspire update --channel staging failed while upgrading an AppHost from Aspire 13.5.3 to 17.0.0. The CLI reported only:
Failed to restore packages for project C:\Development\Source\Contoso\Src\Contoso.AppHost\Contoso.AppHost.csproj after update.
The debug log recorded the restore process exiting with code 1, but did not include its stdout/stderr or the underlying NuGet error. The Aspire CLI exited with code 13.
Reproducing the upgraded restore using disposable copies of the project files exposed the actual error:
C:\Program Files\dotnet\sdk\10.0.404\NuGet.targets(198,5): error : Access to the path 'Aspire.Hosting.Tasks.dll' is denied.
This was caused by a surviving MSBuild worker holding the task DLL loaded after the AppHost had been stopped. aspire ps no longer reported the affected AppHost running. The worker's ownership has not been established; it may be a reusable build worker or IDE/design-time process, rather than an Aspire-managed runtime resource.
All application names and application paths in this report have been replaced with Contoso.
Expected Behavior
- When the post-update restore fails, display the underlying restore diagnostics, and include them in the CLI log, rather than reporting only a generic restore failure.
- If Aspire owns the surviving build worker, investigate releasing its task-assembly locks when the AppHost is stopped. If the worker is intentionally shared or IDE-owned, clarify that boundary rather than indiscriminately terminating shared build processes.
Steps To Reproduce
Observed sequence:
-
Use a Windows AppHost with a repository-local staging package cache at
Src\.nugetpackages. -
Run the AppHost and then stop it. Confirm the affected AppHost is no longer listed by
aspire ps. -
An MSBuild worker remains with this exact assembly loaded:
C:\Development\Source\Contoso\Src\.nugetpackages\aspire.hosting.apphost\17.0.0\tools\net10.0\Aspire.Hosting.Tasks.dll -
Before the local cache was ignored by Git, run
git clean -fd. Git removes the other untracked package files but cannot unlink the loaded DLL:Unlink of file 'Src/.nugetpackages/aspire.hosting.apphost/17.0.0/tools/net10.0/Aspire.Hosting.Tasks.dll' failed. Should I try again? (y/n) n warning: failed to remove Src/.nugetpackages/aspire.hosting.apphost/17.0.0/tools/net10.0/Aspire.Hosting.Tasks.dll: Invalid argument -
Run
aspire update --channel stagingand accept the proposed 13.5.3 -> 17.0.0 package updates and NuGet configuration changes. -
The post-update restore attempts to replace the incomplete cached package, fails on the locked DLL, and the CLI shows only the generic error above.
The cached Aspire.Hosting.AppHost/17.0.0 directory was inspected afterward: only its tools directory remained. Replaying a locally captured restore binlog confirmed that NuGet failed while deleting this incomplete package installation before reinstalling it.
The exact mechanism that originally created the lingering MSBuild worker has not yet been reduced to a standalone repro. No successful retry after shutting down that worker has been verified.
Exceptions (if any)
CLI exception:
Aspire.Cli.Projects.ProjectUpdaterException: Failed to restore packages for project C:\Development\Source\Contoso\Src\Contoso.AppHost\Contoso.AppHost.csproj after update.
Underlying exception from the reproduced restore binlog:
System.UnauthorizedAccessException: Access to the path 'Aspire.Hosting.Tasks.dll' is denied.
at System.IO.FileSystem.RemoveDirectoryRecursive(String fullPath, WIN32_FIND_DATA& findData, Boolean topLevel)
at System.IO.FileSystem.RemoveDirectory(String fullPath, Boolean recursive)
at System.IO.DirectoryInfo.Delete(Boolean recursive)
at NuGet.Packaging.PackageExtractor.<>c__DisplayClass6_0.<<InstallFromSourceAsync>b__0>d.MoveNext()
Anything else?
-
OS: Windows.
-
Development environment: VS Code and Aspire CLI.
-
Aspire CLI:
17.0.0+148071e36dbb16c1cad260dedec2496871b6f49a. -
Aspire CLI build ID:
17.0.26.56603. -
CLI/update channel:
staging. -
AppHost target framework:
net10.0. -
Restore used .NET SDK
10.0.404. -
The process confirmed to have the exact DLL loaded was
MSBuild.exe, PID45424, with command line:"C:\Program Files\dotnet\sdk\11.0.100\MSBuild.exe" /nologo /nodemode:8
The CLI logging gap appears to be in ProjectUpdater.UpdateProjectAsync: the call to runner.RestoreAsync supplies NuGetRestoreTargetsFile but no stdout/stderr callbacks, then throws a generic ProjectUpdaterException on a nonzero exit code. The runner forwards output to the supplied callbacks, so the actionable restore error is lost on this path. Capturing and surfacing failed-restore output would make this substantially easier to diagnose.
Raw logs and binlogs are intentionally not attached because they contain environment-specific feed configuration. The excerpts above are sanitized.
Activity
joperezr commentedon Nov 17, 2026
🤖 Aspire triage pass — 2026-11-17 01:10 UTC
Area:
area-cliKind: bug
Repro: partial — observed sequence and reproduction limitations are described in lines 31–61 of the issue body; no standalone worker-creation repro or successful recovery is established
Affected version(s): staging CLI 17.0.0, build 17.0.26.56603; attempted AppHost update from 13.5.3 to 17.0.0 (last working: not established; latest published release: 13.6.5)
Severity: S3 — failed-restore diagnostics are missing in a Windows staging update involving an incomplete package cache; broad impact and Aspire ownership of the locking worker are unconfirmed
Urgency: ⚪ backlog — no milestone
Reason: actionable diagnostics report, but current evidence describes an edge scenario and does not establish a regression, broad impact, or sufficient priority for the configured active train
Suggested owner(s): pending human availability check — highest-scoring candidate is
davidfowl(score 73 within bounded samples); no ping because GitHub status could not be verified within repository-scoped queriesEvidence:
area-clion/after 2026-10-18 UTC, contributing 72 points: Give dotnet run apphost.cs the aspire run startup budget in SingleFileAppHostInit E2E test #21967, Fix flaky ComputeRunArgumentsPopulatesRunPropertiesForSdkProject (MSBuild server fallback notice on stderr) #21955, Fix RepositoryTemplate_ResolvesRefsAndReusesPinnedCheckoutsAcrossInvocations timeout on slow Git checkouts #21952, Serve NuGet search paging test from memory to unblock macOS CLI CI #21832, Pin public npm registry for Dependabot in template and JsPublish lockfile directories #21660, Fix K8s PV E2E race waiting for recreated StatefulSet pod #21654, Capture CLI diagnostics when an E2E command hangs #21651, Don't discard completed process output when the thread pool is backlogged after exit #21626, Make EnvironmentChecker timeout tests deterministic with TimeProvider #21618, Gate JavaScript runtime CLI E2E checks on AppHost readiness #21617, Ignore just-published npm releases in Docker CLI E2E shells #21615, Treat backchannel close during RequestStopAsync as a completed stop #21602, Fix flaky NuGetPackagePrefetcher cancellation logging test #21599, Warn when AspireCliPath overrides a DNX AspireCliInvocationMode #21592, Fix StopNonInteractiveTests launch-port collision between generated AppHosts #21583, Only show 'Stopping Aspire' when canceling aspire run #21561, Keep captured output when ProcessCaptureRunner's post-exit drain bound expires #21556, Avoid Add-Type compile in detached Windows null-stdin CLI test #21549, Clean up stranded telemetry hook temp files and name the script on failure #21508, Fix flaky ComputeRunArgumentsPopulatesRunPropertiesForSdkProject (NuGet audit warning on stderr) #21502, Fix CLI telemetry persistence tests racing the exporter's eager storage drain #21499, Use a version-specific CLI bundle for pinned DNX AppHost invocations #21473, Stop dotnet CLI from exporting its own OTLP telemetry for project resources #21454, Build the CLI before MCP initialization in McpDocsE2ETests #21450.area-cli, contributing 1 point; assignment does not establish who closed it.Confidence: medium
Needs human?: yes — reconcile stale release-routing configuration, verify candidate availability, and establish worker ownership and a standalone reproduction before lifecycle changes
[release/17.0] Fix AppHost channel updates and restore diagnostics (#…