Open aaronamm opened 3 years ago
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
I think the keypoint of this is from https://github.com/dotnet/sdk/blob/release/5.0.2xx/src/BuiltInTools/dotnet-watch/BrowserRefreshServer.cs#L45 which cause the dynamic port.
It would be great if it take a value from ASPNETCORE_AUTO_RELOAD_WS_ENDPOINT instead of DOTNET_WATCH_AUTO_RELOAD_WS_HOSTNAME and replace scheme if it's need.
@CliXiD Thank you for the information. I think what you have pointed out is the right direction to solve this issue.
However, setting DOTNET_WATCH_AUTO_RELOAD_WS_HOSTNAME
variable does not solve the issue since a port number is still dynamic.
I wonder if we can have some way to specific a port number as well.
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
In dotnet 7 it's still not working. Any news about this issue?
Is this possible in 8? For us migrating from e.g. js not to be able to hotreload on all parts of your app seems a bit dated
Hello everyone
I have setup a Docker compose file with a custom image to launch ASP.NET Core MVC app with
dotnet watch run
. However, I can't make a browser to auto reload when some code has been changed.This is because a container does not publish a port number that
aspnetcore-browser-refresh.js
use to create a WebSocket connection.I found that we have
ASPNETCORE_AUTO_RELOAD_WS_ENDPOINT
defined in https://github.com/dotnet/sdk/blob/release/5.0.2xx/src/BuiltInTools/BrowserRefresh/BrowserScriptMiddleware.cs#L23 but setting a value ofASPNETCORE_AUTO_RELOAD_WS_ENDPOINT
environment variable does not change a WebSocket endpoint. It always get a random port number whenever we rundotnet watch run
and cause me to not be able to configure a published port number in a Docker compose file.Here is a screenshot of the WebSocket issue.
How to reproduce an issue:
Please follow the instruction in this README https://github.com/codesanook/Codesanook.EFNote#how-to-run-the-project-locally
My development environment
Enable integration with my default WSL distro
mcr.microsoft.com/dotnet/sdk:5.0
https://github.com/codesanook/Codesanook.EFNote/blob/main/Dockerfile#L2Please could you help me figure it out how to make a stick port number of WebSocket in a browser reload script? Thanks.
Other useful information
docker-compose down --volumes
to remove a container with its volumes.