Hot Reload in .NET 6 In 10 Minutes or Less

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ธ.ค. 2024

ความคิดเห็น • 106

  • @mikaelekroth3304
    @mikaelekroth3304 3 ปีที่แล้ว +3

    First of all I will thank you for your awesome videos. Have teach me a lot when I will easy deep dive in something.
    This feature have I waiting after for long time. This make it interesting to use when developing webb apps like Anguler, React or other interesting js framework. So you have only one place to develop. I mostly use both VS Code for frontend developing and VS for backend. .NET 6 looks like it gonna be awesome!

  • @Mosern1977
    @Mosern1977 3 ปีที่แล้ว +1

    Thanks for this short and to the point video. Really helpful. Will use this in Blazor I think.
    Fast dev-cycle is very important.

  • @abhikarne
    @abhikarne 3 ปีที่แล้ว

    I love this series for quick learning

  • @conradvancoller2942
    @conradvancoller2942 3 ปีที่แล้ว

    Such a cool feature, thanks for showing it off!

  • @JoeLizFamily4
    @JoeLizFamily4 2 ปีที่แล้ว +2

    Makes the dev/test cycle so much faster. Was very slow when you needed to stop and restart just to see how a small change affected how things look.

  • @Jashobantac
    @Jashobantac 3 ปีที่แล้ว +1

    XAML had this, I had been using it a lot. Also we were allowed to change code during a debugging session and update values by using interactive window. But this really helps..

    • @IAmTimCorey
      @IAmTimCorey  3 ปีที่แล้ว +2

      Yep, they started in XAML and moved it out to everywhere.

  • @rivox1009
    @rivox1009 3 ปีที่แล้ว +4

    XAML hot reload was a thing even in VS2019 afaik though.
    Can you now also change the C# code? For instance fix a method in the ViewModel on the fly

    • @IAmTimCorey
      @IAmTimCorey  3 ปีที่แล้ว +6

      It was previewed in 2019 but wasn’t released for production in it. And yes, you can change C# code on the fly.

  • @cysecgnz
    @cysecgnz 3 ปีที่แล้ว

    Thanks for the video, Mothy.

    • @IAmTimCorey
      @IAmTimCorey  3 ปีที่แล้ว +1

      lol you are welcome.

  • @petrutarabuta5617
    @petrutarabuta5617 3 ปีที่แล้ว

    Amazing feature. Looking forward to using it in WPF apps.

  • @franky1517
    @franky1517 3 ปีที่แล้ว +2

    Would like to see more about dynamic components please, thanks!

  • @iamnoob7593
    @iamnoob7593 ปีที่แล้ว

    thanks tim , A great tool hot reload --> when any changes code level at exceution by adding extra code hot reload on file save or click hot reload , instead of stopping the application and run again.

  • @peoplearecool8766
    @peoplearecool8766 2 ปีที่แล้ว

    This is best explanation so far on youtube, thank you, BTW your hot reload works so fast, what is your computer specifications ? you should have very good cpu I guess...

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว

      Hot reload seems to work rather fast on all machines I've tried, but my recording machine is a bit of a beast. I built it by hand. It is an AMD Ryzen Threadripper 3970X (32-core) with 256GB of RAM, 2TB NVMe SSD, and GeForce RTX 2070. It is overkill for most things, but I actually put it to good use when processing videos and audio files.

  • @bensmith6004
    @bensmith6004 3 ปีที่แล้ว +1

    Will Hot Reload work with Azure Functions? I use them a great deal in my day to day work and having Hot Reload when testing would be very helpful, as opposed to restart

    • @IAmTimCorey
      @IAmTimCorey  3 ปีที่แล้ว +5

      During development yes. After they are deployed to Azure no.

  • @nazariiboichyshyn4300
    @nazariiboichyshyn4300 3 ปีที่แล้ว

    What about docker? Will it ever work if i am developing container?

  • @TheMostafa5000
    @TheMostafa5000 3 ปีที่แล้ว

    that was awesome

  • @bohuang3122
    @bohuang3122 2 ปีที่แล้ว

    It's very useful!

  • @jkgold2006
    @jkgold2006 3 ปีที่แล้ว

    Thank's your information very usefull.

  • @Chess_Improvement
    @Chess_Improvement 3 ปีที่แล้ว

    excellent

  • @VG-vn8kk
    @VG-vn8kk 3 ปีที่แล้ว

    Reminds me of the Browser Link extension for Visual Studio. How this is different for web projects?

    • @IAmTimCorey
      @IAmTimCorey  3 ปีที่แล้ว

      This one works. :-)
      But the concept is the same.

  • @-amiri-officialchannel5853
    @-amiri-officialchannel5853 3 ปีที่แล้ว

    It works only in debug mode (f5). Not when u start the application with Ctrl+f5.

    • @IAmTimCorey
      @IAmTimCorey  3 ปีที่แล้ว

      It will work without debugging as well so if it is not for you, that’s a bug.

  • @brianviktor8212
    @brianviktor8212 3 ปีที่แล้ว

    First of all, good explanation. Assuming it works as intended, it appears to be a mildly convenient tool. But I have yet to see a use-case where it truly shines, some use-case where something can be done what otherwise could not be. Editing a XAML can be seen well enough in the editor. Reloading a HTML is done manually anyway. I guess we'll have to see, but I think the feature is overhyped. Not that I oppose it, I'm just not sure if I will ever use it - as I currently only work on projects which are more complex and need to be deployed, or are compiled in Unity. And the minor (demo) WPF projects I have are not that big of a deal. I'd like to see people making experience with that and reporting what they think about it after that, and when, how and how often they use it.

  • @quochieule5724
    @quochieule5724 2 ปีที่แล้ว

    For WPF application, hot reload sometimes doesn't work when changing styles resources and resource dictionary.

  • @irajosooli9026
    @irajosooli9026 3 ปีที่แล้ว

    Is it possible only in the development stage?
    We can have it in product without new version in minor changes???

    • @IAmTimCorey
      @IAmTimCorey  3 ปีที่แล้ว

      This is for development, not production, yes.

  • @Jashobantac
    @Jashobantac 3 ปีที่แล้ว

    @Tim, can you please create a video on AOP? I use spring AOP and want to use similar one in .NET. Seems postsharp is the only option..

    • @IAmTimCorey
      @IAmTimCorey  3 ปีที่แล้ว +1

      I will add it to the list. Thanks for the suggestion.

  • @TheAngelOfDeath01
    @TheAngelOfDeath01 3 ปีที่แล้ว

    OOhhhh... Microsoft you beautiful beast you... this is gonna make layout development sooo freaking much easier, especially when doing CSS, javascript, etc. where you can write your razor code and dummy data directly as you go without needing to restart your whole application.
    Remember back when we started out with classic ASP, Corey, and coded in Frontpage? ;-)

    • @IAmTimCorey
      @IAmTimCorey  3 ปีที่แล้ว +1

      Yep, this is pretty great and it doesn’t cause the code behind mess that FrontPage did.

  • @farsidesc4044
    @farsidesc4044 3 ปีที่แล้ว

    Dumb question perhaps, but wasn’t hot reload for web initially utilized with the “browser link” feature, before using their current methodology?

    • @IAmTimCorey
      @IAmTimCorey  3 ปีที่แล้ว +1

      Kind of, yeah, but it never worked right.

  • @chrisjohansson9971
    @chrisjohansson9971 3 ปีที่แล้ว

    So you saying Hot reload in .net 6. you mentioned though it will work in all frame
    works the hot reload? so if i'm using .net 5 right now the hot reload will work. What visual studio are you running here to get that to work.

    • @IAmTimCorey
      @IAmTimCorey  3 ปีที่แล้ว

      Visual Studio 2022, which comes out in early November.

  • @zulfiqar7967
    @zulfiqar7967 3 ปีที่แล้ว

    Will hot reload supports for .net framework 4.6 ???

  • @IBNEKAYESH
    @IBNEKAYESH 3 ปีที่แล้ว

    What's the plan for WinForms? Please guide me. Still, I'm working desktop solution with this framework.

    • @IAmTimCorey
      @IAmTimCorey  3 ปีที่แล้ว +2

      Not sure what you mean. It is still a project type and it is still being brought to new versions of .NET. The improvements just aren’t that plentiful.

  • @maheshk2451
    @maheshk2451 3 ปีที่แล้ว

    You mentioned it works with VS code, can you make a video on that? I tried it with using cli dotnet watch but running into problems auto build (cannot access files which are used by another process). May be i am not doing it right or I should use .Net 6 preview?

    • @IAmTimCorey
      @IAmTimCorey  3 ปีที่แล้ว +1

      I'll add that to the suggestion list.

  • @michaelschneider603
    @michaelschneider603 3 ปีที่แล้ว

    Devel conveniences aside, so can this be used to bug-fix or upgrade production servers, e.g. based on ASP NET-Core, without having to shut them off for maintenance? So all these usual potential troubles could be avoided, such as interrupting background workers in the middle of their work; or interrupting requests via network to other servers; or re-sending and thus duplicating messages; or message queues filling up while the consuming instance is down; or having to wait for all users to log off or to kick them off forcefully? That would be huge! (And it would then be understandable why Microsoft may have wanted to keep hot-reload as an exclusive for-pay feature)!

    • @IAmTimCorey
      @IAmTimCorey  3 ปีที่แล้ว +1

      No, this is for debugging. It can’t change a compiled application that has been deployed.

    • @liftcarryfetish1296
      @liftcarryfetish1296 3 ปีที่แล้ว

      @@IAmTimCorey Why don't we have any visual designers or some way to lay out the components in a a drag and drop way anymore? Remember WebForms? Yeah, real time saver. Even Mobile Apps and Desktop Apps have their development IDEs with visual designers, why we don't have anything for the web anymore?
      Remember FrontPage?

    • @IAmTimCorey
      @IAmTimCorey  3 ปีที่แล้ว

      Because those designers never really created good, semantic pages. They got the job done but the back-end of the page was MESSY. I do remember FrontPage. I loved it, but it created ugly, hard to maintain pages behind the scenes. Getting a good drag and drop editor to work on the web using web standards is very difficult and often not worth the effort. For instance, if you drag a paragraph onto the page, what is the surrounding tag? Is it is a div (it probably shouldn't be semantically)? An article? The list goes on. When you change the font size of a heading, are you changing the heading level (the level of indent in the site outline) or just tweaking the sizing? When you drag an image onto the page, are you intending to float it? Put it in a grid? Use flex? With just a heading, a paragraph, and an image, you already have multiple choices that a machine cannot answer for you that you have to face. Each will be context- and content-specific. The web really isn't designed to be created by WYSIWYG editors. It is too complex. Editors that do it usually do so poorly or with very limited scope.

    • @liftcarryfetish1296
      @liftcarryfetish1296 3 ปีที่แล้ว

      @@IAmTimCorey But still Tim, my point is, it's not impossible to build at least some basic designer to kick start our web page layouts.

    • @IAmTimCorey
      @IAmTimCorey  3 ปีที่แล้ว

      But my example was as basic as it gets and it still wouldn’t work.

  • @aikidoshi007
    @aikidoshi007 3 ปีที่แล้ว

    I found a bug with Hot Reload in a .NET Core web application. If one creates a ViewBag item in the controller and references it on the View, it works as expected, but if the value in the viewbag is then changed and saved, the application crashes when Hot Reload tries to work it out!

    • @IAmTimCorey
      @IAmTimCorey  3 ปีที่แล้ว +1

      Interesting. Have you submitted it?

  • @BK-19
    @BK-19 3 ปีที่แล้ว

    Will it work with Web project (.Net core web application ?) I tied but no luck

    • @IAmTimCorey
      @IAmTimCorey  3 ปีที่แล้ว

      Yep. It works with all ASP.NET Core web project types, as well as WinForms and WPF. Basically, it works everywhere in Visual Studio 2022 (and from the command line).

  • @bradclarke93
    @bradclarke93 ปีที่แล้ว

    does this work in VS 2022 for Mac?

    • @IAmTimCorey
      @IAmTimCorey  ปีที่แล้ว

      Yes, I’m pretty sure it does.

    • @bradclarke93
      @bradclarke93 ปีที่แล้ว

      @@IAmTimCorey ok I will keep looking I dont have the little fire icon :)

    • @IAmTimCorey
      @IAmTimCorey  ปีที่แล้ว

      Try it from the command line by running dotnet watch in your project directory.

    • @bradclarke93
      @bradclarke93 ปีที่แล้ว

      @@IAmTimCorey YES , that works thank you

  • @neilcarberry10
    @neilcarberry10 3 ปีที่แล้ว

    Can you use this with a Blazor wasm app?

    • @IAmTimCorey
      @IAmTimCorey  3 ปีที่แล้ว +2

      Yes.

    • @codefoxtrot
      @codefoxtrot 3 ปีที่แล้ว +2

      @@IAmTimCorey I find it only works for Blazor Wasm when using "Start Without Debugging" mode.

    • @neilcarberry10
      @neilcarberry10 3 ปีที่แล้ว +1

      @@codefoxtrot Yeh thats the same with me. I found that trying to do it whilst debugging and making any html/razor changes the wee Edit and Continue warning pops up

    • @DukenJR
      @DukenJR 3 ปีที่แล้ว +1

      @@neilcarberry10 For me there's no popup. Just doesn't do anything. Unless I "Start without debugging" as mentioned above.

    • @codefoxtrot
      @codefoxtrot 2 ปีที่แล้ว +1

      Fix is pending release -- VS2022 Blazor WASM Hot Reload under the debugger. Should be contained in next VS2022 update from Microsoft.

  • @animeboy93
    @animeboy93 3 ปีที่แล้ว

    It's gonna be like A1 Steak Sauce. I'm gonna use that shit on everything.

  • @alii2284
    @alii2284 9 หลายเดือนก่อน

    how to do it on Mac FGS

    • @IAmTimCorey
      @IAmTimCorey  9 หลายเดือนก่อน

      You can't use Visual Studio on a Mac. You can use VS Code, and that has hot reload capabilities. Just know that it will look different than this video.

  • @dosomething3
    @dosomething3 3 ปีที่แล้ว

    absolutely terrific video format 🥂

  • @xantari79
    @xantari79 3 ปีที่แล้ว

    Tried this on an ASP .NET Core .NET 6 MVC project and it doesn't work :(

    • @IAmTimCorey
      @IAmTimCorey  3 ปีที่แล้ว

      It should work, so if it doesn't then it is a bug. Might be just on your PC or it might be something larger. Submit an issue through Visual Studio please.

  • @MuhammadYousaf-wp6wj
    @MuhammadYousaf-wp6wj หลายเดือนก่อน

    Note : It does not work in winform applications.

    • @IAmTimCorey
      @IAmTimCorey  หลายเดือนก่อน +1

      It has been supported on Windows Forms since .NET 6: learn.microsoft.com/en-us/visualstudio/debugger/hot-reload?view=vs-2022

  • @Jashobantac
    @Jashobantac 3 ปีที่แล้ว

    Hot Reload is Hot.. 💥

  • @amazur31
    @amazur31 3 ปีที่แล้ว +1

    ooh boi, this is going to introduce so many "wtf why isnt this working correctly"

    • @willinton06
      @willinton06 3 ปีที่แล้ว

      It’ll probably be unbreakable by .NET 7 or 8

    • @amazur31
      @amazur31 3 ปีที่แล้ว +1

      @@willinton06 i was thinking more about forgetting that the state is saved during debugging, can easily lead to problems

    • @IAmTimCorey
      @IAmTimCorey  3 ปีที่แล้ว +1

      I'm not sure why. You are just editing your application while it is running. That's the big deal. If you don't have that, you edit your application and then run it.

  • @hawarhekmat1174
    @hawarhekmat1174 3 ปีที่แล้ว

    Linux ?

    • @IAmTimCorey
      @IAmTimCorey  3 ปีที่แล้ว +1

      It works on Linux too since it works on the command line.

    • @hawarhekmat1174
      @hawarhekmat1174 3 ปีที่แล้ว

      @@IAmTimCorey thanks mr Tim for your great work 😊

  • @kandycan
    @kandycan 3 ปีที่แล้ว

    Dude why don't u make a discord server

    • @IAmTimCorey
      @IAmTimCorey  3 ปีที่แล้ว

      Because it isn’t that simple. It takes time and resources and takes away from other things I could be doing. I have a forum for people who buy courses. That provides better long-term value than Discord and is easier to moderate.

  • @pxnchx93
    @pxnchx93 3 ปีที่แล้ว

    Poor XAML live preview... there's a new cool kid in town... u.u

    • @IAmTimCorey
      @IAmTimCorey  3 ปีที่แล้ว +1

      The same developers who did XAML live preview brought hot reload to all of .NET.

    • @pxnchx93
      @pxnchx93 3 ปีที่แล้ว

      @@IAmTimCorey Yeah I imagined that, they same to be very similar technologies underneath

  • @fahadal-gamdi7024
    @fahadal-gamdi7024 3 ปีที่แล้ว

    Thanks , no need to restart vs2019 again to see changes ...