microsoft / microsoft/aspire

ProjectResource sets its state to "Running" before it is finished building

Open
#20,167 1 comment 0 reactions 0 assignees View on GitHub
area-orchestrator needs-area-label triage:bot-seen
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Describe the bug

When my C# project resources start, they immediately display as "Running" (or "Running (Unhealthy)" for the ones with health checks). I would expect them to have their state set to "Building" while the build process is running, so that I can tell whether a resource is actually unhealthy or just hasn't finished building yet.

I see this behaviour with both `.WithProject(name, path)` and `.WithCSharpApp(name, path)`.

I'm currently using Aspire 13.5.4, but was also seeing the same behaviour with 13.3.0, so it's not a newly introduced issue.

### Expected Behavior

Project resources show as "Building" in the dashboard while a build is in progress.

### Steps To Reproduce

Repo: [vgeronimos/aspire-project-building-repro](https://github.com/vgeronimos/aspire-project-building-repro)

Nothing special, it is a `dotnet new aspire` and `dotnet new console`, but the `.csproj` for the console project has an artificial 60 second delay added into the build process.

### Exceptions (if any)

_No response_

### Aspire doctor output

```plain
Aspire Environment Check
========================

Aspire
✅ Aspire CLI version 13.5.4 (channel: stable)
✅ Developer Control Plane (DCP) connection health checks succeeded

.NET SDK
✅ .NET 10.0.303 installed (x64)

Container Runtime
✅ Podman v6.1.0: running (configured via ASPIRE_CONTAINER_RUNTIME=podman) ← active

Environment
✅ Operating system: Windows 10.0.26200.0
✅ HTTPS development certificate is trusted

Development Tools
✅ Aspire extension for VS Code is installed

Summary: 7 passed, 0 warnings, 0 failed

Aspire CLI Installations
========================

╭─────────────────────────────────────────────────────────────┬─────────────────────────────────────────────────┬─────────┬───────────┬─────────────╮
│ Path │ Version │ Channel │ Route │ PATH status │
├─────────────────────────────────────────────────────────────┼─────────────────────────────────────────────────┼─────────┼───────────┼─────────────┤
│ C:\Users\vassili.geronimos\.aspire\bin\aspire.exe (current) │ 13.5.4+9c1b401dd67746739044f68959cbf4d3d7af93a6 │ stable │ (unknown) │ active │
╰─────────────────────────────────────────────────────────────┴─────────────────────────────────────────────────┴─────────┴───────────┴─────────────╯
```

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the linked vgeronimos/aspire-project-building-repro and its delayed console-project build, then trace how .WithProject(name, path) and .WithCSharpApp(name, path) assign resource state. Reproduce the delayed build and verify that the dashboard shows "Building" until completion, including resources with health checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.