microsoft / microsoft/aspire

`AddCSharpApp` should enter a failed state if the project's runtime is unavailable

Open
#16,068 0 comments 0 reactions 0 assignees View on GitHub
area-app-model
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

If you call `builder.AddCSharpApp("frontend", "./FileBasedApps.WebFrontEnd/")` on a project without a valid framework installed, the resource enters the `Exited` state, but without indicating any kind of failure - either on the dashboard, or in the VS Code extension.

Image

### Expected Behavior

This should have being displayed as a failure state with some kind of exit code.

### Steps To Reproduce

Run `/playground/FileBasedApp` when you don't have a .Net 8 runtime installed.

### Exceptions (if any)

```
[frontend] Executing command 'start'.
[frontend] Successfully executed command 'start'.
[frontend] You must install or update .NET to run this application.
[frontend]
[frontend] App: /Users/alex/Developer/aspire/artifacts/bin/FileBasedApps.WebFrontEnd/Debug/net8.0/FileBasedApps.WebFrontEnd.dll
[frontend] Architecture: arm64
[frontend] Framework: 'Microsoft.NETCore.App', version '8.0.0' (arm64)
[frontend] .NET location: /usr/local/share/dotnet/
[frontend]
[frontend] The following frameworks were found:
[frontend] 9.0.4 at [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
[frontend] 9.0.6 at [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
[frontend] 10.0.3 at [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
[frontend]
[frontend] Learn more:
[frontend] https://aka.ms/dotnet/app-launch-failed
[frontend]
[frontend] To install missing framework, download:
[frontend] https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=8.0.0&arch=arm64&rid=osx-arm64&os=osx.26
```

### Aspire doctor output

Aspire Environment Check
========================

.NET SDK
✔ .NET 10.0.103 installed (arm64)

Container Runtime
⚠ Docker Desktop is installed but not running
Start Docker Desktop
See: https://aka.ms/dotnet/aspire/containers

Environment
✔ HTTPS development certificate is trusted
⚠ HTTPS development certificate has an older version (v5)
Run 'aspire certs clean' to remove all certificates, then run
'aspire certs trust' to create and trust a new one.
See: https://aka.ms/aspire-prerequisites#dev-certs
Details:
Older certificate versions (< v4) may not support all certificate
trust scenarios.

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.