aspire: Error in Aspire run: failed to connect to IDE run session notification endpoint websocket bad handshake

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I have used the .NET Aspire Starter App template with .NET 8, Configure for HTTPS, Use Redis enabled, and an NUnit Test project to create a .NET Aspire project to create a project from scratch. Haven’t changed any code, only pressing the run button in VS. The app fails to run with the following error. This only has an issue on this device, running the same code on a separate device (another PC) works completely fine.

info: Aspire.Hosting.DistributedApplication[0]
      Aspire version: 8.1.0+d304c5f6f15bcd4f34f1841b33870cfab88e6937
info: Aspire.Hosting.DistributedApplication[0]
      Distributed application starting.
info: Aspire.Hosting.DistributedApplication[0]
      Application host directory is: REDACTED
fail: Aspire.Hosting.Dcp.dcpctrl.IdeExecutableRunner[0]
      failed to connect to IDE run session notification endpoint, retrying...   {"error": "websocket: bad handshake"}
info: Aspire.Hosting.DistributedApplication[0]
      Now listening on: https://localhost:17230
info: Aspire.Hosting.DistributedApplication[0]
      Login to the dashboard at https://localhost:17230/login?t=ff3925101bf740a21d18c3f8143f5f74
info: Aspire.Hosting.DistributedApplication[0]
      Distributed application started. Press Ctrl+C to shut down.
fail: Aspire.Hosting.Dcp.dcpctrl.IdeExecutableRunner[0]
      failed to connect to IDE run session notification endpoint, retrying...   {"error": "websocket: bad handshake"}

There was a similar issue - https://github.com/dotnet/aspire/issues/4437 but the error messages are different. I have downgraded to .NET 8 from .NET 9 but that doesn’t seem to have helped.

Expected Behavior

For the Aspire app to run.

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version info

dotnet --version 8.0.400

Anything else?

Microsoft Visual Studio Community 2022 Version 17.11.2 VisualStudio.17.Release/17.11.2+35222.181 Microsoft .NET Framework Version 4.8.09032

Windows 11 Pro, Version 23H2

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 22 (11 by maintainers)

Most upvoted comments

@mithileshz make sure that you have the latest “ASPNET and web development” VS workload installed on the misbehaving machine (run Visual Studio Installer and update or repair as appropriate). The most likely reason for this error is that the version of the Aspire tools you have inside Visual Studio is outdated.