Open JonHodgins opened 9 months ago
Some more testing results:
Hot reload always works if running a single docker container (with and without docker compose).
Hot reload will usually fail (with no obvious pattern that I can see) using docker compose with multiple containers. Using the above two container repo, usually only one will work, but I've had both work once and both fail once.
@JonHodgins a quick update: I was able to repro this when debugging, but not through Ctrl+F5. I've reached out to the debugger team and they are investigating.
For me it fails to work entirely. With Ctrl+F5 the Hot Reload button in the toolbar is even greyed out. Making changes to a razor file confirms "Changes were successfully applied." but nothing becomes visible. Also running within Docker Compose project.
VS: Version 17.9.2
@lvde0 can you please open a new issue with specific repro instructions? I just tested Blazor Web Apps as a single project in a container and with a compose app using Ctrl+F5, and it worked.
@NCarlsonMSFT I think I narrowed it down to:
<DockerDevelopmentMode>Regular</DockerDevelopmentMode>
Default Blazor.Mud template with Docker Compose orchestration runs hot reload just fine. But changing the DockerDevelopmentMode
seems to break it.
EDIT: So DockerDevelopmentMode
is definitely an issue, but it's not the only problem it seems. With two web app projects only one of them actually allows hot reload (As @JonHodgins described).
@NCarlsonMSFT Is there any update from the debugger team about this?
@lvde0 you're right that <DockerDevelopmentMode>Regular</DockerDevelopmentMode>
disables hot reload.
I've pinged the debugger team to see if they have any updates.
@NCarlsonMSFT Even in the latest version of VS I still cannot get Hot Reload to work reliably with two docker projects. It seem to work sometimes when running without debugger (Ctrl + F5), but even that is quite flaky and for some components (like dialogs for instance) it doesn't work at all. I am assuming there's no further info about this issue from the VS team?
@lvde0 I've pinged the debugger team, no update yet. Trying myself, Hot Reload is working for me with two Web API projects when I Ctrl+F5. Can you give me any more details on the repro where it doesn't update? For instance, there are some known limitations, such as compiled CSS files.
I also encounter this problem especially when the solution contains a lot of projects. As a temporary workaround, I usually delete the created container or close the solution and delete the .vs folder if this isn't enough. Also, the problem usually happens when I stop the debugger when the program is paused on a breakpoint.
Hot reload for multiple services with F5 should be fixed in the next preview
@NCarlsonMSFT https://github.com/microsoft/DockerTools/issues/322#issuecomment-1934949539
Here's a minimal reproducible example: two identical Blazor Web App projects created from the default template, HotReloadTest and HotReloadTest2.
Hot reload works in HotReloadTest, but does not work in HotReloadTest2. The output window says "Changes were successfully applied." for both.
Repo: https://github.com/JonHodgins/HotReloadTest