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 on MAUI Blazor App does not works. #2527

Closed
wthks opened this issue Sep 16, 2021 · 12 comments
Closed

Hot Reload on MAUI Blazor App does not works. #2527

wthks opened this issue Sep 16, 2021 · 12 comments
Assignees
Labels
area-blazor Blazor Hybrid / Desktop, BlazorWebView s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@wthks
Copy link

wthks commented Sep 16, 2021

Whenever i start debugging the Maui Blazor App and do any changes the live preview is not changing. I already checked all options in the settings. do I need to activate something?

@Eilon Eilon added the area-blazor Blazor Hybrid / Desktop, BlazorWebView label Sep 16, 2021
@Eilon
Copy link
Member

Eilon commented Sep 16, 2021

Hi @HeroinGyrl , we're still working on getting some Hot Reload scenarios working. It does already work in a limited capacity on some platforms, but it isn't fully functional everywhere.

On which platform were you trying to use Hot Reload?

@wthks
Copy link
Author

wthks commented Sep 16, 2021

hey @Eilon I created the latest MAUI Blazor App template and started debugging on windows whenever I change something it doesnt worked. I use Visual Studio Preview 2022 4 and the latest .NET 6 version

@Eilon
Copy link
Member

Eilon commented Sep 16, 2021

Got it. There's a known issue right now that to get Blazor to re-render your updates in *.razor files you need to click somewhere in Blazor (such as on a button) and then it will re-render that part of the UI. It's supposed to be 100% automatic but there's a bug right now preventing that.

@wthks
Copy link
Author

wthks commented Sep 16, 2021

but somehow even in a xaml file the hot reload is not changing .
Screenshot 2021-09-16 220505
.

@SteveSandersonMS
Copy link
Member

For WinForms,

  • Editing .razor content does already hot reload and auto re-renders
  • Editing .razor.css does not hot reload for multiple reasons:
    • It doesn't load the aspnetcore-browser-refresh.js script so it doesn't get notification
    • Even if you add that script content manually, VS doesn't trigger any update messages to say things have changed
  • Editing some-static.css does not hot reload for multiple reasons:
    • You can't actually save changes to any file like that, because VS says the file is locked as long as the app is running
    • Even if you that was fixed, I think it's still not going to reload because VS is meant to achieve that through Browser Link, which is not connected to pages loaded inside a BlazorWebView

I think similar problems will occur on WPF and MAUI too (except on MAUI, .razor content changes don't yet trigger an auto re-render).

@pranavkm @mkArtakMSFT Since fixing this might involve VS changes (e.g., to issue change notifications when .razor.css is updated - does that need to work based on some new project capability?), should we bump this up the schedule order? We probably don't want to wait until RC2 before asking for a VS change.

@mkArtakMSFT
Copy link
Member

Here is the issue tracking the CSS Hot Reload work for MAUI: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1453953

@Amir-Care
Copy link

Repro , attached the repro sample MauiApp15.zip

@Amir-Care Amir-Care added the s/verified Verified / Reproducible Issue ready for Engineering Triage label Feb 23, 2022
@davidaxtelius
Copy link

Hot reload and .net does not come hand in hand...
What we do on our team is we write the css and html in VSCode - with live server. Then copy paste in into blazor app (MAUI etc).

Without proper hot reload - building apps with blazor is almost useless.

@SteveSandersonMS
Copy link
Member

For WinUI,

  • Editing .razor content partially works. The change is applied via hot reload, but the UI doesn't update until you manually trigger a further re-rendering (e.g., navigate between pages or click a button with a C# event handler).
  • Editing .razor.css doesn't hot reload at all
  • Editing .css doesn't hot reload at all

@SteveSandersonMS
Copy link
Member

@mkArtakMSFT To the best of my recollection, Pranav was the main one coordinating a plan for getting hot reload to work. This likely involves some tooling work. Do you know if someone is now looking at this? Hot reload is something we can't leave waiting as we may be dependent on other teams to make this work in VS.

@Redth Redth added this to the 6.0.300 milestone Mar 23, 2022
@javiercn javiercn removed their assignment Mar 25, 2022
@danroth27
Copy link
Member

Hot reload for .NET MAUI Blazor apps is blocked on https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1471373, which is expected to be fixed in VS 17.3 P1.

@mkArtakMSFT
Copy link
Member

Closing this as the work on the Blazor side is done. The end to end experience, however, will light up only after related VS changes will be made, which is planned to happen for VS 17.3-preview1.

@ghost ghost locked as resolved and limited conversation to collaborators May 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Blazor Hybrid / Desktop, BlazorWebView s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

10 participants