dotnet / dotnet/aspnetcore

VS 2022 17.9.4 Hot Reload Razor Pages Project run debug WebSocket failed to connect.

Open
#54,769 5 comments 0 reactions 0 assignees View on GitHub
area-commandlinetools feature-hot-reload
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Describe the bug

aspnetcore-browser-refresh.js:268 WebSocket connection to 'ws://localhost:58957/XuanHe.Web/' failed:
(anonymous) @ aspnetcore-browser-refresh.js:268
getWebSocket @ aspnetcore-browser-refresh.js:265
(anonymous) @ aspnetcore-browser-refresh.js:16
aspnetcore-browser-refresh.js:19 WebSocket failed to connect.
aspnetcore-browser-refresh.js:23 Unable to establish a connection to the browser refresh server.

![image](https://github.com/dotnet/aspnetcore/assets/37821420/efc2ca4c-86e5-42c5-9acf-43c4e343ee81)

### Expected Behavior

_No response_

### Steps To Reproduce

IDE ![image](https://github.com/dotnet/aspnetcore/assets/37821420/4ed1c753-aee6-4d74-a290-ebfb02a8ad75)

Project configure
```


net7.0
enable
enable
Linux
..\..










....
```

### Exceptions (if any)

aspnetcore-browser-refresh.js:268 WebSocket connection to 'ws://localhost:58957/XuanHe.Web/' failed:
(anonymous) @ aspnetcore-browser-refresh.js:268
getWebSocket @ aspnetcore-browser-refresh.js:265
(anonymous) @ aspnetcore-browser-refresh.js:16
aspnetcore-browser-refresh.js:19 WebSocket failed to connect.
aspnetcore-browser-refresh.js:23 Unable to establish a connection to the browser refresh server.

![image](https://github.com/dotnet/aspnetcore/assets/37821420/efc2ca4c-86e5-42c5-9acf-43c4e343ee81)

### .NET Version

8.0.202

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure with the shown Microsoft.NET.Sdk.Web project, Visual Studio 2022 17.9.4, and the listed .NET versions. Inspect the reported aspnetcore-browser-refresh.js WebSocket connection and its localhost URL. Done means the Razor Pages debug session connects to the browser refresh server without the reported console errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.