Hot Reload of .NET 6 & Visual Studio 2022 in (buggy) action & how to make it work

Поділитися
Вставка
  • Опубліковано 12 вер 2024
  • 🔥 .NET Jumpstart Course: www.udemy.com/...
    📧 Newsletter: newsletter.pat...
    ❤️ Ko-fi: ko-fi.com/patr...
    ☕ Coffee: www.buymeacoff...
    🐦 Twitter: / _patrickgod
    🙏MANY THANKS TO THESE LOVELY PEOPLE:
    Grant Burdon
    @gianluigiconti
    Gerrit Esmeijer
    Illia
    Németh-Pók István
    Michael Mel
    Marko Zdilar
    GerryB
    @DADA_universe
    Domen Hren
    @heroesch
    István Csibor
    Carey
    Peter De Tender
    Baris Keskin
    Someone
    @Big_Bear_27390
    Mathias
    walter e watkins
    Günther Dassel
    Axel
    Josh
    Daniel Huber
    Fredric Adell
    Juan Carlos
    Manolis
    Pajani
    P.
    Jonas Granlund
    Someone
    Bobby
    Kristina
    @xamarin007
    #DotNet #VisualStudio #PatrickGod

КОМЕНТАРІ • 13

  • @williameisenman5538
    @williameisenman5538 2 роки тому +1

    I think that hot reload only works in razor and code in razor reliably

  • @grumpydeveloper69
    @grumpydeveloper69 2 роки тому

    In the case of your example @9:26 this does not display the change because the message was produced by a request. Hot reload has no way to know that the current page is affected by your code change. Only changes in the page source, or components on the page are picked up with hot reload

    • @PatrickGod
      @PatrickGod  2 роки тому +2

      That's correct and totally fine. I was just hoping, that it would reload the page as it was doing with .NET 5 and the "dotnet watch run" command. 😉

  • @donmikkodanm.olmillo8154
    @donmikkodanm.olmillo8154 2 роки тому +1

    Hi Patrick! Would love to ask, I would really love to buy the .NET 5 Jumpstart course especially the Black Friday is on sale right now on Udemy, but I am also scared that eventually you will provide another .NET 6 course and not update the .NET 5 one. Would love to ask what's your plan to provide on your .NET 6 course, will it be added on the ".NET 5 & .NET 3.1 Jumpstart" or will it be separated? Thank you

    • @PatrickGod
      @PatrickGod  2 роки тому +1

      Hi Donmikko! Thanks for reaching out. The .NET 6 update will definitely be available to everyone already enrolled in the .NET 5 Jumpstart course. 😊 Please use the following link: www.udemy.com/course/net-core-31-web-api-entity-framework-core-jumpstart/?couponCode=BLACKFRIDAY2021 With enrollment, you'll also get a huge early bird discount for the upcoming Blazor E-Commerce course (also .NET 6). Hope this resonates with you. Take care & happy coding! Patrick

    • @donmikkodanm.olmillo8154
      @donmikkodanm.olmillo8154 2 роки тому +1

      @@PatrickGod Thank you for this wonderful news Patrick :) I will surely buy it right now and will also be excited for the E-Commerce bootcamp course.

    • @PatrickGod
      @PatrickGod  2 роки тому +1

      Thank you soooooo much!

  • @grumpydeveloper69
    @grumpydeveloper69 2 роки тому

    With the code change at @10:25 you change both the interface and the service which is also beyond hot reload. You can change anything inside the service methods.
    Then also after you apply @10.50, and you have an error the hot reload ends up with the dreaded "An unhandled erro has occured" on the page. That can only be fixed by a full page reload. @11:10 you don;t get an error, hot reload simply did not reload your page after you fix the error in your code. You still have to full reload the page.
    The following error @11:23 after the full reload is unexpected. I'm not sure whether efter fixing the method call a new hot reload patch was applied since the app was previously in a strange state. You stop the app instea of trying other hot reload options suh as explicitely patcghing with the flame button so it's not sure what this is. I could be a buggy situation.
    I do agree that hot reload was presented as a silver bullet option where you could almost start an empty app and program it while runnign ith hot relod, this is af course not the case. There as for sure a lot of restrictions to hot reload but to call it "buggy".... i'm not directy convinced.

    • @grumpydeveloper69
      @grumpydeveloper69 2 роки тому

      yup @13:10 it does work. SOrry I am typing this while watching. Would have been better to watch everything first 🙂 before commenting

    • @PatrickGod
      @PatrickGod  2 роки тому +2

      @@grumpydeveloper69 Same here as above. Rebuilding is totally fine, but I was hoping that it recognizes the file changes, the proper fixes even, to be more precise, and rebuild the page by itself. That's not the case, unfortunately. Well, at least not every time. Sometimes it does. And that's why I'm calling it "buggy". I'm sure there is a better name. Do you have one? 😊
      The big issue for me is, that with .NET 5 and VS 2019 or VS Code the watcher simply rebuild the app after any file change and I was able to continue developing smoothly.
      But now, I'm sometimes given the impression that something is wrong with my code, which could absolutely be the case, but it isn't. That's bad. I'd prefer a smooth automatic rebuild over a sometimes working hot reload and sometimes working automatic rebuild.
      But still, I'm confident that this thing will improve our developer lives in the near future. I mean, we've got this thing for just over a week, so let's just give it a bit more time.
      Hope this makes things clear.
      Have a good one!
      Take care,
      Patrick

  • @jennyl4275
    @jennyl4275 2 роки тому

    I am running on VS2022 17.1.6 and I got the same problem as you said. Change the blazer file, but changes are not reloaded. After tried diffrent ways, it suddently worked. Don't know why.

  • @greenwc
    @greenwc 2 роки тому +1

    IMO, it’s just not ready for prime time. You can waste -hours- on chasing problems related to this feature. The best experience for now is to disable and revisit in the future.

    • @PatrickGod
      @PatrickGod  2 роки тому

      Or restart the app by yourself. Even with the latest update. I'm with you. A bit sad, but I'm confident they'll figure it out and it will get better.