Who is using Hot Reload?

%3CLINGO-SUB%20id%3D%22lingo-sub-2922647%22%20slang%3D%22en-US%22%3EWho%20is%20using%20Hot%20Reload%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2922647%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20digging%20Hot%20Reload.%20Anyone%20using%20it%3F%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D4S3vPzawnoQ%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D4S3vPzawnoQ%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2922647%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3E.NET%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3E.Net%20Core%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2923392%22%20slang%3D%22en-US%22%3ERE%3A%20Who%20is%20using%20Hot%20Reload%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2923392%22%20slang%3D%22en-US%22%3EYup%2C%20love%20it...%20Plain%20old%20ASP%20Core%20API...%20Make%20some%20changes%2C%20hit%20the%20fire%20button%20and%20enjoy!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2927363%22%20slang%3D%22en-US%22%3ERe%3A%20Who%20is%20using%20Hot%20Reload%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2927363%22%20slang%3D%22en-US%22%3EHot%20Reload%20in%20%60dotnet%20watch%60%20is%20great.%20Just%20a%20few%20days%20ago%20I%20used%20Hot%20Reload%20in%20a%20*console*%20application%20to%20generate%20DTOs%20from%20yet%20another%20dreaded%20%22Excel%20Requirements%20Document%22.%20Make%20a%20change%20to%20the%20source%2C%20save%2C%20check%20the%20outcome%2C%20repeat%20until%20satisfied.%3CBR%20%2F%3E%3CBR%20%2F%3EI%20used%20VS%20Code%20as%20the%20editor%20but%20I%20could%20easily%20have%20used%20Sublime.%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2927507%22%20slang%3D%22en-US%22%3ERe%3A%20Who%20is%20using%20Hot%20Reload%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2927507%22%20slang%3D%22en-US%22%3ETook%20a%20look%20at%20hot%20reload%20in%20this%20video.%20They%20added%20some%20changes%20to%20launchSettings.json%20and%20then%20seemed%20to%20have%20rolled%20those%20back.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DT6iP7QPWmPI%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DT6iP7QPWmPI%3C%2FA%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2928124%22%20slang%3D%22en-US%22%3ERe%3A%20Who%20is%20using%20Hot%20Reload%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2928124%22%20slang%3D%22en-US%22%3EYes%2C%20but%20unfortunately%20I%20could%20not%20use%20C%23%20code%20hot%20reload%20in%20WinUI3%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2928515%22%20slang%3D%22en-US%22%3ERE%3A%20Who%20is%20using%20Hot%20Reload%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2928515%22%20slang%3D%22en-US%22%3EWhat%20issues%20did%20you%20run%20into%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2928758%22%20slang%3D%22en-US%22%3ERe%3A%20Who%20is%20using%20Hot%20Reload%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2928758%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F741493%22%20target%3D%22_blank%22%3E%40shanselman%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3EI%20am%2C%20and%20it's%20awesome!%3CBR%20%2F%3EThanks%20for%20the%20video%20by%20the%20way!%3CBR%20%2F%3EQuick%20question%20though%3A%3CBR%20%2F%3EWhy%20doesn't%20it%20work%20when%20the%20while%20loop%20is%20in%20the%20%60OutputPid()%60%20function%20instead%20of%20in%20%22Main()%22%3F%20Does%20it%20have%20something%20to%20do%20with%20not%20being%20able%20to%20rewrite%20the%20static%20entrypoint%3F%20I%20don't%20understand%20how%20having%20the%20while%20loop%20in%20the%20%60OutputPid()%60%20function%20rewrites%20that%20entrypoint%3F%3CBR%20%2F%3EThanks!%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2928975%22%20slang%3D%22en-US%22%3ERE%3A%20Who%20is%20using%20Hot%20Reload%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2928975%22%20slang%3D%22en-US%22%3EAs%20soon%20as%20I%20get%20to%20install%20VS%202022%20GA%20next%20week%20and%20learn%20how%20to%20use%20it%2C%20I%20will%20be.%20lol%20Still%20waiting%20till%20the%20tooling%20is%20fully%20baked%20for%20release.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2931462%22%20slang%3D%22en-US%22%3ERe%3A%20Who%20is%20using%20Hot%20Reload%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2931462%22%20slang%3D%22en-US%22%3EI%20use%20it%20and%20I%20like%20it!%3CBR%20%2F%3E%3CBR%20%2F%3E%23blazor%20%23razor%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2931550%22%20slang%3D%22en-US%22%3ERE%3A%20Who%20is%20using%20Hot%20Reload%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2931550%22%20slang%3D%22en-US%22%3EI%20tried%20using%20it%20on%20a%20large%20Blazor%20Wasm%20project%20and%20ran%20into%20all%20kinds%20or%20problems%2C%20and%20errors.%20It%20ended%20up%20being%20faster%20to%20dev%20when%20it%20is%20turned%20off.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2932410%22%20slang%3D%22en-US%22%3ERE%3A%20Who%20is%20using%20Hot%20Reload%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2932410%22%20slang%3D%22en-US%22%3EI%20tried%20with%20.NET%20MAUI%20but%20it%20wasn't%20working%20very%20well%2C%20when%20I%20edited%20my%20code%20during%20runtime%20I%20got%20an%20error%20that%20I%20needed%20to%20restart%20the%20application.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2933409%22%20slang%3D%22en-US%22%3ERe%3A%20Who%20is%20using%20Hot%20Reload%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2933409%22%20slang%3D%22en-US%22%3E%3CP%3EI've%20tried%2C%20but%20think%20I'm%20doing%20something%20wrong.%3CBR%20%2F%3E%3CBR%20%2F%3EMade%20a%20new%20.NET%20Maui%20App.%20Ticked%20hot%20reload%20on%20save.%20I%20made%20a%20simple%20change%20to%20my%20XAML%20and%20saved%20it.%20My%20UI%20was%20not%20updated.%20Then%20clicked%20the%20hot%20reload%20button%20multiple%20times.%20Waited%20a%20bit.%20Hit%20it%20some%20more%20times.%20Given%20up%20on%20hot%20reload%20for%20now.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2966218%22%20slang%3D%22en-US%22%3ERe%3A%20Who%20is%20using%20Hot%20Reload%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2966218%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F119540%22%20target%3D%22_blank%22%3E%40Mahdi%20Hosseini%3C%2FA%3E%26nbsp%3BI%20found%20a%20workaround%20to%20get%20hot%20reload%20working%20in%20VS%202022%2017.1%20Pre%201%20-%20see%20%3CA%20href%3D%22https%3A%2F%2Ftwitter.com%2Fvincenth_net%2Fstatus%2F1460273173484744710%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehere.%3C%2FA%3E%3CBR%20%2F%3EIt%20works%20great%20in%20.NET%205%20and%20.NET%206.%3CBR%20%2F%3E%3CBR%20%2F%3EI%20am%20using%20hot%20reload%20to%20create%20%23CSharpForMarkup%20gen%202%20with%20C%23%2010%3CBR%20%2F%3Ecc%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F741493%22%20target%3D%22_blank%22%3E%40shanselman%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2969587%22%20slang%3D%22en-US%22%3ERe%3A%20Who%20is%20using%20Hot%20Reload%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2969587%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1208124%22%20target%3D%22_blank%22%3E%40VincentH_NET%3C%2FA%3E%26nbsp%3BI%20don't%20understand%20the%20fix.%20I%20can't%20find%20PublishReadyToRun%20in%20my%20solution%20anywhere.%20Perhaps%20I%20have%20a%20different%20issue%20with%20hot%20reload%2C%20but%20I%20might%20just%20have%20misunderstood%20something.%20Am%20I%20missing%20something%3C%2FP%3E%3C%2FLINGO-BODY%3E
Microsoft

I'm digging Hot Reload. Anyone using it? https://www.youtube.com/watch?v=4S3vPzawnoQ

15 Replies
Yup, love it... Plain old ASP Core API... Make some changes, hit the fire button and enjoy!
Hot Reload in `dotnet watch` is great. Just a few days ago I used Hot Reload in a *console* application to generate DTOs from yet another dreaded "Excel Requirements Document". Make a change to the source, save, check the outcome, repeat until satisfied.

I used VS Code as the editor but I could easily have used Sublime.
Took a look at hot reload in this video. They added some changes to launchSettings.json and then seemed to have rolled those back.

https://www.youtube.com/watch?v=T6iP7QPWmPI
Yes, but unfortunately I could not use C# code hot reload in WinUI3
What issues did you run into?

@shanselman 
I am, and it's awesome!
Thanks for the video by the way!
Quick question though:
Why doesn't it work when the while loop is in the `OutputPid()` function instead of in "Main()"? Does it have something to do with not being able to rewrite the static entrypoint? I don't understand how having the while loop in the `OutputPid()` function rewrites that entrypoint?
Thanks!

As soon as I get to install VS 2022 GA next week and learn how to use it, I will be. lol Still waiting till the tooling is fully baked for release.
I use it and I like it!

#blazor #razor
I tried using it on a large Blazor Wasm project and ran into all kinds or problems, and errors. It ended up being faster to dev when it is turned off.
I tried with .NET MAUI but it wasn't working very well, when I edited my code during runtime I got an error that I needed to restart the application.

I've tried, but think I'm doing something wrong.

Made a new .NET Maui App. Ticked hot reload on save. I made a simple change to my XAML and saved it. My UI was not updated. Then clicked the hot reload button multiple times. Waited a bit. Hit it some more times. Given up on hot reload for now.

@Mahdi Hosseini I found a workaround to get hot reload working in VS 2022 17.1 Pre 1 - see here.
It works great in .NET 5 and .NET 6.

I am using hot reload to create #CSharpForMarkup gen 2 with C# 10
cc @shanselman 

@VincentH_NET I don't understand the fix. I can't find PublishReadyToRun in my solution anywhere. Perhaps I have a different issue with hot reload, but I might just have misunderstood something. Am I missing something

@nogginbox My fix was for a WinUI 3 Preview 3 Desktop app; I don't know whether it applies to a Maui project (which is implemented on top of WinUI for the Windows target only).


Anyway, in a WinUI 3 Desktop app the PublishReadyToRun setting is found in the application's publish profiles, maybe you can find in in a Maui project as well:

VincentH_NET_0-1637061646845.png

 

It's Maui, but as far as I know still using WinUI 3 under the hood. However, there are no publish settings. So they're either not used or hidden as part of the cross platform stuff. It feels like the same problem though.