aspire icon indicating copy to clipboard operation
aspire copied to clipboard

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

Open jeffa00 opened this issue 1 year ago • 11 comments

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 avatar Sep 23 '24 19:09 jeffa00

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.

jeffa00 avatar Sep 23 '24 21:09 jeffa00

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

RobertWeaver avatar Sep 24 '24 12:09 RobertWeaver

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

captainsafia avatar Sep 24 '24 14:09 captainsafia

"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:

  • The version of C# Extension + C# Dev Kit used.
  • Is the AppHost not starting to debug or are the projects listed under the AppHost not starting to debug?

WardenGnaw avatar Sep 24 '24 16:09 WardenGnaw

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.

captainsafia avatar Sep 24 '24 17:09 captainsafia

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 avatar Sep 24 '24 18:09 jeffa00

Also, can run AppHost from the CLI.

jeffa00 avatar Sep 24 '24 18:09 jeffa00

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

smitpatel avatar Sep 24 '24 23:09 smitpatel

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

RobertWeaver avatar Sep 25 '24 04:09 RobertWeaver

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.

kamalraj2000 avatar Sep 27 '24 17:09 kamalraj2000

Same- M3, all good until latest OSequoia upgrade

Fiontan avatar Sep 30 '24 18:09 Fiontan

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.

DamianEdwards avatar Oct 08 '24 20:10 DamianEdwards

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

captainsafia avatar Oct 09 '24 16:10 captainsafia

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

xtqqczze avatar Oct 09 '24 19:10 xtqqczze

My debugging works after upgrading as well.

webreidi avatar Oct 11 '24 22:10 webreidi

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

kamalraj2000 avatar Oct 19 '24 16:10 kamalraj2000

Thanks for the confirmations folks. Closing this out.

DamianEdwards avatar Oct 19 '24 23:10 DamianEdwards