You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a new Maui Project add the code below in app.cs
#if DEBUG
[assembly: System.Reflection.Metadata.MetadataUpdateHandlerAttribute(typeof(HangulClock.HotReloadService))]
public static class HotReloadService
{
#pragma warning disable CS8632 // The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
public static event Action<Type[]?>? UpdateApplicationEvent;
#pragma warning restore CS8632 // The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
internal static void ClearCache(Type[]? types) { }
internal static void UpdateApplication(Type[]? types) {
//if ((types != null && types.Length > 0 && types[0] != null))
//{
UpdateApplicationEvent?.Invoke(types);
//}
}
}
Then in content page add the code below:
ContentPage:
voidBuild(){Content=newVerticalStackLayout{Spacing=20,Margin=20,Children={(label=newLabel{Text="Welcome to .NET MAUI!",FontSize=64,TextColor=Colors.Blue}),(entry=newEntry{Placeholder="Enter your name"}),}};label.SetBinding(Label.TextProperty,static(Entrye)=>e.Text,source:entry);}
If I first hit CMD+S then the output I get is:
17:45:7 💡 Possible changes were found.
17:45:9 No changes were found.
And from then on in that debug session even hitting the hot reload fire button doesn't work.
When I instead hit fire button as the first action of the debug session, then CMD+S works as well as the button. I've confirmed that several times now.
Also, previously I encountered a situation with the button not appearing. Since the "solution" was updating VS Code Insider, I'm unable to repro right now. I have experience though several times when reloading the window and restarting extensions won't fix an issue, but upon applying a pending VS Code update the issue resolves.
Testing Android, the hot reload option (fire button) wasn't appearing in the debug button list. I reloaded the window, got some error about a connecting being closed, and reloaded again... Finally I saw that VS Code Insider wanted to apply an updated, so I figured what do I have to lose. After restarting I am now able to see the button for hot reload when debugging Android, except that I cannot debug the app and there is not .NET Hot Reload output window option. It's like the debugger is hung, probably on some invisible hot reload breakpoint. When I stop debugging I see the app (was frozen on the splash). Restarting debugging does fully initialize and I can interact with the app. After hitting the hot reload button I can now see the option for the output window.
Extension version: 1.9.2
VS Code version: Code - Insiders 1.92.0-insider (b23e791eb5afbd95f05aa24da7693ce89344a079, 2024-07-09T05:03:50.549Z)
OS version: Darwin arm64 23.5.0
Modes:
Create a new Maui Project add the code below in app.cs
#if DEBUG
[assembly: System.Reflection.Metadata.MetadataUpdateHandlerAttribute(typeof(HangulClock.HotReloadService))]
Type: Bug
My code
If I first hit
CMD+S
then the output I get is:And from then on in that debug session even hitting the hot reload fire button doesn't work.
When I instead hit fire button as the first action of the debug session, then
CMD+S
works as well as the button. I've confirmed that several times now.Also, previously I encountered a situation with the button not appearing. Since the "solution" was updating VS Code Insider, I'm unable to repro right now. I have experience though several times when reloading the window and restarting extensions won't fix an issue, but upon applying a pending VS Code update the issue resolves.
Extension version: 1.9.2
VS Code version: Code - Insiders 1.92.0-insider (b23e791eb5afbd95f05aa24da7693ce89344a079, 2024-07-09T05:03:50.549Z)
OS version: Darwin arm64 23.5.0
Modes:
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: