microsoft / microsoft/aspire

[AspireE2E] When running the Aspire starter app for Redis using dotnet watch and stopping the execution by pressing Ctrl+C, an error occurs: Unexpected error reading the output of session '2'

Open
#17,590 2 comments 0 reactions 0 assignees View on GitHub
area-cli external triage:bot-seen
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 12h
Merged PRs (30d)
201

Description

**REGRESSION INFO**: Also repro on Aspire 13.3.5

**INSTALL STEPS**
1. Clean machine: Windows11 25h2 x64
2. Install SDK 10.0.300
3. Add feeds
4. Install Aspire.ProjectTemplates 13.4.0
`dotnet new install Aspire.ProjectTemplates::13.4.0 --force`
5. Install Podman - 5.8.2

**REPRO STEPS**

1. Open CMD, create an Aspire Starter App using following commands:
```
dotnet new aspire-starter --use-redis-cache -o aspire01
cd aspire01/aspire01.AppHost
```
2. Run the project using `dotnet watch`, open the dashboard to confirm that all resources are running successfully.
3. Close the dashboard, then press Ctrl+C to stop execution.

**ACTUAL**
An error occurred in CMD.

https://github.com/user-attachments/assets/0f89a5e5-eb26-4a09-8cdf-39677406d9e9

```
dotnet watch ❌ Unexpected error reading output of session '2': System.Threading.Tasks.TaskCanceledException: A task was canceled.
at Aspire.Tools.Service.AspireServerService.SendMessageAsync(String dcpId, Byte[] messageBytes, CancellationToken cancellationToken)
at Aspire.Tools.Service.AspireServerService.SendNotificationAsync[TNotification](TNotification notification, String dcpId, String sessionId, CancellationToken cancellationToken)
at Microsoft.DotNet.Watch.AspireServiceFactory.SessionManager.<>c__DisplayClass16_1.<g__StartChannelReader|0>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.DotNet.Watch.AspireServiceFactory.SessionManager.<>c__DisplayClass16_1.<g__StartChannelReader|0>d.MoveNext()
```

Image

**EXPECTED**
No error.

Contributor guide

Open the contributing guide

Research direction

Reproduce the Windows 11 failure with the Aspire starter app, Redis cache, Podman, and dotnet watch, then trace the Ctrl+C shutdown path from Aspire.Tools.Service.AspireServerService.SendMessageAsync through SessionManager.StartProjectAsync. Done means stopping the app with Ctrl+C exits without the unexpected session-output error.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, redis
Domain
cli, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.