Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hot reload not working when running in ASP.NET Core hosted mode #5

Open
ErnieBernie10 opened this issue Dec 12, 2021 · 2 comments
Open
Labels
help wanted Extra attention is needed

Comments

@ErnieBernie10
Copy link

I was integrating a TailBlazor WASM template into my application. Noticed hot reload wasnt working when I launch it from a .Net Core hosted project that also contains the REST API. Only when I run the individual TailBlazor project does hot reload work.

@McNerdius
Copy link
Owner

McNerdius commented Dec 12, 2021

Update: I assumed dotnet watch would be functionally equivalent to Ctrl+F5 / Start Without Debug. Nope.

With Ctrl+F5 i'm getting DOM updates and the Counter increment updates, but changes to the Weather Controller's values still aren't reflected.

I'll keep an eye on any changes in behavior as i do my tweaks to the hosted template and compare that to the blazorwasm single-project.


I haven't used hosted mode myself yet so i may be doing something wrong, but... Starting with a fresh default Hosted template, i couldn't get Hot Reload to work at all, from VS or CLI.

The edits i made all did the little checkmark indicator, but no functional difference was observed.  I had "Hot Reload on File Save" enabled but also did manual-hot-reloads via the button to no avail:

Setting Weather Summaries to include only "Scorching":

https://i.imgur.com/2zCi4TQ.gif

These others might not be as relevant but...

Editing `MainLayout.razor` didn't reflect the changes in the DOM, even after a manual refresh:

https://i.imgur.com/BenGE2T.gif

Editing the Counter increment also had no effect:

https://i.imgur.com/nsdsbXg.gif

---

I'll still put together an initial Tailwind-ized Hosted template this afternoon/tomorrow and do some reading on Hot Reload as it relates to Hosted projects but this initial experience has me scratching my head... Why *wouldn't* the default template be working ?  Surely i must be missing something lol.


@ErnieBernie10
Copy link
Author

I also did a lot of searching around and from what I read, hosted mode just doesn't work at all with hot reload so it's not really related to your tailwind integration.

As a workaround I am just launching the two hosts separately on separate ports, one for the UI and one for the API. After that, hot reloading does work. It's just a bit annoying. I think with later versions of hot reload this might get improved.

Though if you find a way to make it work that would be great and please reply in this thread about it.

@McNerdius McNerdius pinned this issue Dec 18, 2021
@McNerdius McNerdius added the help wanted Extra attention is needed label Dec 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants