Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Martin Griffiths 826 posts 1269 karma points c-trib
    Apr 28, 2022 @ 08:55
    Martin Griffiths
    0

    Warren's umbraco 9 hot reload YouTube demonstration

    I was pretty excited about this as hot reload is one of many fun new things in .net 6 that I thought I could leverage in Umb9.

    So, I went through this tutorial using a build I created from the Umbraco Template in VS2022 17.2.0 Preview 5. Upgraded to .net 6 and made the necessary changes as in the video. CSS changes continue to stream in fine, but .cshtml files didnt work at all, what made it all the worse is refreshing the browser failed as well, still no changes! Only a complete rebuild dropped in the changes, BAH!

    Doing some further research I built a default .net 6 MVC template project.....all good changes worked fine with all file types, you don't even have to declare .cshtml in the csproj as an additional watch item. Once I added the Umbraco 9 package to this default 6 project and tweaked the program.cs to get Umbraco running, it all fell down again. Same problem as before, no cshtml changes getting reflected in the browser and no reload either, useless! In the console I get the following lines each time, "./xxxx.cshtml file changed, no deltas modified - Applying changes to clear diagnostics - no hot reload changes to apply" - very weird!

    I'm thinking the way Umbraco hijacks routes over a standard MVC project may have something to do with this problem, maybe the deltas are getting skipped and this should be explored?

    Finally, reverting the project back to .net 5.0 but continuing to use dotnet watch (run? - the differences escape me!), I was pleasantly surprised to find, just about everything demonstrated in the video actually works fine, I get CSS streamed in changes, cshtml/cs changes automatically trigger a rebuild and the browser is reloaded (after a bit of a pause). So while hot reload may bring additional speed benefits, you actually get all you need pretty much out of the box anyway!

    One final note I also added Ligersharks awesome weboptimizer pipeline to my project and I'm getting SCSS files streamed into my project, it even works when making changes in the browser. Fabulous!

Please Sign in or register to post replies

Write your reply to:

Draft