dotnet / aspire

Tools, templates, and packages to accelerate building observable, production-ready apps
https://learn.microsoft.com/dotnet/aspire
MIT License
3.88k stars 467 forks source link

Errors debugging Aspire in VS Code on Mac after upgrading to Sequoia #5860

Closed jeffa00 closed 3 weeks ago

jeffa00 commented 1 month ago

Discussed in https://github.com/dotnet/aspire/discussions/5822

Originally posted by **jeffa00** September 21, 2024 After upgrading to Sequoia I get an error trying to start debugging on the AppHost project. The specific error I get is "The JSON-RPC connection with the remote party was lost before the request could complete." Google and Bing haven't yielded much help. I find a similar error in Visual Studio from back in 2019ish, but nothing recent. I've uninstalled extensions, then VS Code, but no joy. I can debug the web app just fine, but the error always occurs when trying to start AppHost. I'm trying to figure out if it is indeed something in Sequoia. I have a work mac with Sonoma that doesn't have the issue. Just curious if anyone else has seen this or if I'm just super lucky. :-)
jeffa00 commented 1 month ago

FYI I am on an M2, so Apple silicon. Someone else replied in the discussion topic I originally created that on an Intel Mac, he is not experiencing the same error.

RobertWeaver commented 1 month ago

I also have the same issue. M1 with Aspire 8.2.0

Here is what I can see... image

My dotnet --info

.NET SDK:
 Version:           9.0.100-rc.1.24452.12
 Commit:            81a714c6d3
 Workload version:  9.0.100-manifests.67cd1eb6
 MSBuild version:   17.12.0-preview-24422-09+d17ec720d

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  15.0
 OS Platform: Darwin
 RID:         osx-arm64
 Base Path:   /usr/local/share/dotnet/sdk/9.0.100-rc.1.24452.12/

.NET workloads installed:
Configured to use loose manifests when installing new manifests.
 [aspire]
   Installation Source: SDK 9.0.100-rc.1
   Manifest Version:    8.2.0/8.0.100
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/8.0.100/microsoft.net.sdk.aspire/8.2.0/WorkloadManifest.json
   Install Type:        FileBased

Host:
  Version:      9.0.0-rc.1.24431.7
  Architecture: arm64
  Commit:       static

.NET SDKs installed:
  8.0.401 [/usr/local/share/dotnet/sdk]
  9.0.100-rc.1.24452.12 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 8.0.8 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.0-rc.1.24452.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 8.0.8 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.0-rc.1.24431.7 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download
captainsafia commented 1 month ago

I'm seeing the same thing on Apple Silicon (M2) as well. Issue seems to have shown up after the Sequoia upgrade as well. Similar to you, I can debug test cases and other non-Aspire apps fine so I suspect that the bug is manifesting from the Aspire-specific debugging hooks?

I can provide logs but not sure what the right log source is for these specific issues.

cc: @WardenGnaw for any insights on logs we can gather or people we can loop in

WardenGnaw commented 1 month ago

"The JSON-RPC connection with the remote party was lost before the request could complete" is generally something failed with brokered service communication.

I don't think we have specific logs for this section unless you see an actual debug session start.

Things that could be helpful for this investigation:

captainsafia commented 1 month ago

I was able to repro this on both the pre-release and release builds of the extensions.

C# extension version: v2.48.31 (pre-release), v2.45.25 C# Dev Kit version: v1.11.9 (pre-release), v1.10.18

The AppHost itself is not starting to debug.

jeffa00 commented 1 month ago

C#: v2.45.25 C# Dev Kit: v1.10.18

image

The AppHost fails to start, but other apps can start (example an ASP app).

jeffa00 commented 1 month ago

Also, can run AppHost from the CLI.

smitpatel commented 1 month ago

Likely root cause https://github.com/dotnet/announcements/issues/324 AspireServerService is failing to start due to above.

RobertWeaver commented 1 month ago

After trying the workaround here https://github.com/dotnet/runtime/issues/106775#issuecomment-2370577838 I can now launch the dashboard and everything in debug mode but I cannot hit any breakpoints? I did try to add the "requireExactSource" but that does not work either.

image

kamalraj2000 commented 1 month ago

I am also running into this issue on a M3 Mac. It started after upgrading to Sequoia.

C# Dev Kit: v1.10.18 C# Extension: v2.45.25

I can run the AppHost from CLI but not when launching through VSCode debug mode.

Fiontan commented 1 month ago

Same- M3, all good until latest OSequoia upgrade

DamianEdwards commented 1 month ago

The fix for this issue in the .NET SDK was included in today's releases of .NET 8.0.10 and .NET 9.0-rc.2. Would be good if someone can upgrade and confirm the issue is fixed for them.

captainsafia commented 1 month ago

I'm able to debug my Aspire apps after upgrading. Would be good to get confirmation from other folks as well.

xtqqczze commented 1 month ago

8.0.403 was just released that does fix this.

But you need to run:

dotnet dev-certs https --clean

dotnet dev-certs https --trust

And then you should be back in business.

Originally posted by @jhancock-taxa in #9532

webreidi commented 1 month ago

My debugging works after upgrading as well.

kamalraj2000 commented 4 weeks ago

I am also confirming that Aspire debugging is working on a M3 Mac after upgrading to .NET 8.0.10

DamianEdwards commented 3 weeks ago

Thanks for the confirmations folks. Closing this out.