microsoft / microsoft/aspire

.NET services intermittently fail to start with timeout error from VS Code

Open
#8,803 0 comments 5 reactions 0 assignees View on GitHub
area-tooling
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

.NET services will sometimes fail to start when run with Aspire from VS Code. The error from AppHost looks like:
```
Aspire.Hosting.Dcp.dcpctrl.ExecutableReconciler: Error: timeout of 120 seconds exceeded waiting for the IDE to start a run session; you can set the DCP_IDE_REQUEST_TIMEOUT_SECONDS environment variable to override this timeout (in seconds)  {"Executable": {"name":"gateway-pbntfhph"}, "Reconciliation": 41, "error": "Put \"https://localhost:62998/run_session?api-version=2024-04-23\": context deadline exceeded"}
```

Restarting the service from the dashboard does not resolve the issue when this happens.

### Expected Behavior

.NET services should start when Aspire is run with VS Code.

### Steps To Reproduce

Run Aspire project with VS Code. launch.json details below
```
{
"version": "0.2.0",
"configurations": [
{
"name": "ProjectName",
"type": "dotnet",
"request": "launch",
"projectPath": "${workspaceFolder}/AppHost/AppHost.csproj",
},
{
"name": "C#: Launch Aspire Dashboard",
"type": "dotnet",
"request": "launch",
"projectPath": "${workspaceFolder}/AppHost/AppHost.csproj",
"serverReadyAction": {
"action": "openExternally",
"pattern": "Aspire.Hosting.DistributedApplication: Information: Now listening on:\\s+(https?://\\S+)"
}
},
]
}
```

### Exceptions (if any)

Aspire.Hosting.Dcp.dcpctrl.ExecutableReconciler: Error: timeout of 120 seconds exceeded waiting for the IDE to start a run session; you can set the DCP_IDE_REQUEST_TIMEOUT_SECONDS environment variable to override this timeout (in seconds)  {"Executable": {"name":"myservicename-pbntfhph"}, "Reconciliation": 41, "error": "Put \"https://localhost:62998/run_session?api-version=2024-04-23\": context deadline exceeded"}

### .NET Version info

.NET SDK:
Version: 9.0.201
Commit: 071aaccdc2
Workload version: 9.0.200-manifests.21502d11
MSBuild version: 17.13.13+1c2026462

Runtime Environment:
OS Name: Mac OS X
OS Version: 15.4
OS Platform: Darwin
RID: osx-arm64
Base Path: /usr/local/share/dotnet/sdk/9.0.201/

.NET workloads installed:
There are no installed workloads to display.
Configured to use loose manifests when installing new manifests.

Host:
Version: 9.0.3
Architecture: arm64
Commit: 831d23e561

.NET SDKs installed:
9.0.201 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 9.0.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 9.0.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
None

Environment variables:
Not set

global.json file:
Not found

### Anything else?

Microsoft.AspNetCore.App 9.0.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 9.0.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Aspire.Hosting.AppHost 9.2.0

IDE: VS Code 1.99.2

VS Code Extensions:
* C# 2.72.34 (not pre-release)
* C# Dev Kit 1.19.20

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.