Repository navigation
Labels
Description
Current behavior
Expected behavior
just reload and update as normal...
Which tool(s) are affected?
Hot Reload
How to reproduce it (as minimally and precisely as possible)
changes done:
<Page x:Class="DevTKSS.Uno.Samples.MvuxGallery.Presentation.Views.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:DevTKSS.Uno.Samples.MvuxGallery.Presentation.Views"
xmlns:uen="using:Uno.Extensions.Navigation.UI"
xmlns:utu="using:Uno.Toolkit.UI"
xmlns:um="using:Uno.Material"
xmlns:ctk="using:CommunityToolkit.WinUI.Converters"
uen:Region.Name="Main"
NavigationCacheMode="Required"
Background="{ThemeResource BackgroundBrush}">
<Page.Resources>
<ctk:BoolNegationConverter x:Name="InvertBoolConv"/>
</Page.Resources>
<Grid x:Name="MainContentGrid"
uen:Region.Attached="True">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <utu:NavigationBar x:Name="NavBar"
- Grid.Row="0"
- Grid.ColumnSpan="2"
- HorizontalAlignment="Stretch"
- HorizontalContentAlignment="Center"
- VerticalContentAlignment="Center"
- VerticalAlignment="Top"
- Content="{Binding Path=AppTitle, Mode=OneWay}"
- MainCommandMode="Action"
- Background="{ThemeResource PrimaryContainerBrush}"
- Foreground="{ThemeResource OnPrimaryContainerBrush}">
- <utu:NavigationBar.MainCommand>
- <AppBarButton Icon="GlobalNavigationButton"
- Command="{x:Bind NavView.IsPaneOpen, Converter={StaticResource InvertBoolConv}}"
- Width="{x:Bind NavView.CompactPaneLength, Mode=OneWay}"
- HorizontalContentAlignment="Center"/>
- </utu:NavigationBar.MainCommand>
- </utu:NavigationBar>
- <TextBlock Grid.Row="1"
- Grid.Column="0"
- HorizontalTextAlignment="Right"
- Text="Notifier Region:" />
- <TextBlock Grid.Row="1" Grid.Column="1"
- Text="{Binding Path=CurrentNotifierRegion, Mode=OneWay}" />
- <TextBlock Grid.Row="2"
- Grid.Column="0"
- HorizontalTextAlignment="Right"
- Text="Notifier Route:" />
- <TextBlock Grid.Row="2" Grid.Column="1"
- Text="{Binding Path=CurrentNotifierRoute, Mode=OneWay}" />
<NavigationView x:Name="NavView"
- IsBackButtonVisible="Collapsed"
+ IsBackButtonVisible="Auto"
IsPaneToggleButtonVisible="False"
+ IsTitleBarAutoPaddingEnabled="False"
- Grid.Row="3" Grid.ColumnSpan="2"
+ Header="{Binding Greeting, Mode=OneWay}"
- PaneDisplayMode="LeftCompact"
+ PaneDisplayMode="Auto"
uen:Region.Attached="True"
HorizontalAlignment="Stretch">
<NavigationView.MenuItems>
<NavigationViewItem x:Name="NavItemDashboard"
Content="Home"
uen:Region.Name="Dashboard"
Icon="Home" />
<NavigationViewItem x:Name="NavItemCounter"
Content="Counter"
Icon="Calculator"
uen:Region.Name="Counter" />
<NavigationViewItem Content="List View"
uen:Region.Name="Listboard"
Icon="List" />
<NavigationViewItem Content="Let's play Cards!"
uen:Region.Name="SimpleCards"
Icon="Page" />
</NavigationView.MenuItems>
<NavigationView.Content>
<Grid x:Name="NavigationViewContentGrid"
uen:Region.Attached="True"
uen:Region.Navigator="Visibility"
Visibility="Visible"/>
</NavigationView.Content>
</NavigationView>
</Grid>
</Page>Model:
namespace DevTKSS.Uno.Samples.MvuxGallery.Presentation.ViewModels;
public partial record MainModel
{
private readonly INavigator _navigator;
private readonly ILocalizationService _localizationService;
private readonly IStringLocalizer _stringLocalizer;
private readonly IRouteNotifier _routeNotifier;
public MainModel(
ILocalizationService localizationService,
IStringLocalizer stringLocalizer,
INavigator navigator,
IRouteNotifier routeNotifier)
{
_routeNotifier = routeNotifier;
_navigator = navigator;
_localizationService = localizationService;
_stringLocalizer = stringLocalizer;
_routeNotifier.RouteChanged += (s,routeArgs) =>
{
this.CurrentNotifierRoute.SetAsync(routeArgs.Navigator?.Route?.ToString() ?? string.Empty); // actual current nested route
this.CurrentNotifyerRegion.SetAsync(routeArgs.Region?.Name?.ToString()); // no return from this
};
}
- public IState<string> AppTitle => State<string>.Value(this, () => _stringLocalizer["ApplicationName"]);
+ public IState<string> Greeting => State<string>.Value(this, () => _stringLocalizer["ApplicationName"]);
public IState<string> CurrentNotifyerRegion => State<string>.Value(this, () => _navigator.Route?.ToString() ?? string.Empty);
public IState<string> CurrentNotifierRoute => State<string>.Value(this,() => string.Empty);
}
Workaround
Restart App instead HotReload
Renderer
- Skia
- Native
Affected platforms
No response
Uno.Sdk version
6.0.67
IDE used
Visual Studio 2022
IDE version
17.13.6
Uno Platform Extension version
6.0.30.30
Relevant plugins
No response
Anything else we need to know?
Used Right mouse button click >"Rename" command in vs 2022 to rename "AppTitle" to "Greetings"

Activity
agneszitte commentedon May 21, 2025
@dr1rrb, @kazo0 I will let you take a look at the details for this issue
dr1rrb commentedon Jun 16, 2025
@DevTKSS hey, I'm indeed able to see such exception.
It's because when a MVUX Model is being updated, we raise a
PropertyChanged("")(on the ViewModel) to update all bindings. But in you case the binding toAppTitleis no longer valid, causing the exception to be thrown. It will be removed in coming UI update, but we don't have real control on timing here so the update from MVUX might pass before the UI is being updated.However, the exception is catched (https://github.com/unoplatform/uno/blob/master/src/Uno.UI/DataBinding/BindingPath.BindingItem.cs#L301) and should not cause any other issue.
Does the exception was crashing your application? Did you experience any kind of problem after the update, or you opened the issue just to report that the exception was thrown ? (If so, you can mute them by enabling "Just My Code" in debugger options).
DevTKSS commentedon Jun 16, 2025
@dr1rrb yes, everytime I am doing this as you better worded out, my app does crash and I have no other option than to Re-Start instead of HotReload it :( so it would be great if there is any chance to be able to reload instead of restart then in the future
dr1rrb commentedon Jun 18, 2025
Ok I investigated a bit more, the only case I was able to find that is not working with HR, is to "add" (rename == remove + add) a new
Feedthen updating that feed in a second HR operation will not work (Note: it's not related to theHotReloadExceptionitself, more probably just an issue with reflection discovery of feeds).Does this correspond to your case? If not, are you able to give me more details (repro steps / repro app) ?
BTW by "crash the app" I was meaning the app closes. What I understand from "I have no other option than to Re-Start instead of HotReload it" is that it's not the case? It's really about the hot-reload not behaving as expected after the rename?
DevTKSS commentedon Jun 18, 2025
@dr1rrb hm I dont know if this is possible, but from my POV, this here and unoplatform/uno#20438
is talking about the same issue and should get merged to one. I just remembered, that I did send some exception output and mentioned it maybe not just here, so researched also in my "mentioned" notifications to find it.
Would you check on that additional context if that might helps you?
to the crash app:
I am meaning that I runned normally in debug mode, did some modifications, like the renaming of the State Properties in my Model and modified the code in my page as showed in the diff, then I wanted to normally Reload the app, because I am not able to modify the names of properties from the HD GUI, therefore I switched into HotReload to do this, meant to HotReload to then enter again the HD mode and 💥exception showed above. then I was not able to go back into HR/HD mode because it did not let me. It required me to Re-Start the app as without HR
DevTKSS commentedon Jun 18, 2025
and this here included the State thing also partially:
#35 (comment)
dr1rrb commentedon Jun 18, 2025
Ok thanks for the details @DevTKSS 👍If you got both exception during the same debug session, this confirms that the
HRExceptionis actually not the root cause of your issues, but the unoplatform/uno#20438.Working to get the MVUX HR issue fixed, still problematic that a freshly added feed cannot be edited.
BTW For the unoplatform/uno#20438 it's one of the next tasks on my plate. It is actually a bug in roslyn that we have already workaround few times ... hopefully we will be able to do so also for your case (we are supposed to have a bug open for that on roslyn's side).
DevTKSS commentedon Jun 19, 2025
@dr1rrb I am not sure if it was the exact same session and I don't see their differences (missing knowledge)
but if happening its always caused when I am changing the statefull props on the model and reasonable you would when renaming them, change also the binding setup accordingly.
What I did not try so far, as I did not understand that to be exactly recommended from uno docs, to put the model code in a seperate project, to workaround the Roslyn generator problem.
dr1rrb commentedon Jul 7, 2025
QA steps:
MainModel.csand rename theIState<string> Nameto something likeMySuperNameMainPage.xamlupdate the binding ofTextBlockon line 22 to match the new name<TextBox Text="{Binding MySuperName, Mode=TwoWay}"MainModelchange the content of theMySuperNamestate fromState<string>.Value(this, () => string.Empty);toState<string>.Value(this, () => "This is my super app");Name(both inMainModel.csandMainPage.xaml) and also change again the content to the state to something likeState<string>.Value(this, () => "This is the name of my app");Darsh0307 commentedon Jul 7, 2025
@dr1rrb
I am still getting the exception errors. In the step 5 as soon as i save after that i am getting the exception error. I think so that it has the same exception error as mentioned above.
uno.sdk:- 6.1.8
OS:- Window
IDE:- VS
VS:-Version 17.14.5
Exception
$exception {"Attempted to invoke a deleted method implementation. This can happen when a method is deleted or its name or signature is changed while the application is running."} System.Runtime.CompilerServices.HotReloadExceptionMessage
Attempted to invoke a deleted method implementation. This can happen when a method is deleted or its name or signature is changed while the application is running.Detials
Screen.Recording.2025-07-07.at.4.59.39.PM.mov
Screen.Recording.2025-07-07.at.4.52.15.PM.mov
dr1rrb commentedon Jul 7, 2025
@Darsh0307 please don't stop to the exception (we cannot avoid it), press the "Continue" button (or F5) in order to validate if the behavior / HR is still correct.
Darsh0307 commentedon Jul 8, 2025
@dr1rrb
After pressing continue button i was able to validate the changes which we were able to make.
uno.sdk:- 6.1.8
OS:- Window
IDE:- VS
VS:-Version 17.14.5
Screen.Recording.2025-07-08.at.10.37.59.AM.mov
DevTKSS commentedon Jul 14, 2025
@dr1rrb some new feed for you to check on, getting the same error, unrecoverable, no state usage, only x:Name and x:Bind (try) to another control:
https://technischekonstruktion-my.sharepoint.com/:v:/g/personal/info_technische-konstruktion_com/ET9YfAXjdXlJq7If3ezAWBwBhThK1VGvu9kK4hFQpwBx9Q?e=hR7AZV
I were trying to use HD for somehow bind the click on tabBar>TabBarItem or SelectedItem 🤷 to expand the expander if not expanded, so the user would not have to do a second click.
But as soon as I rename using x:Name like shown in the linked video (Github didnt want to allow me to drop it, sorry) it will do one of those behaviours:
used latest available stable release 6.0.146
will now use the SelectionChanged Event (not available on HD) with the following code in the page codebehind:
but as those things are kind of... basics, it would be good, to not break HD with those things maybe?
dr1rrb commentedon Jul 18, 2025
@DevTKSS
It happens that an exception is being re-thrown or more than one exception is thrown, that's why you might have to press more than once the "continue" button. You can repeatedly press it until the application resume, or (recommended) you on the first exception you can uncheck this box (and then press "Continue" (F5) -or "Weiter" in your case ;) - )
To give more details: That exception is being injected by the hot-reload engine to replace body of methods that has been removed, so if you try to invoke such stale method it just throws that exception. When updating (actually "replacing") the visual tree, there are lot of things that happens in parallel and it might happen that a removed method is being invoked (common case are event handlers and x:Bind, for instance a
Unloadhandler pointing to a such stale method).While this exception is usefull to avoid invalid state, there is no real benefit to break on it, so ignoring it is really the recommended option here.
DevTKSS commentedon Jul 18, 2025
@dr1rrb oh okay so can I "ignore" all of the HotReloadException" throws or are there just particular "error codes" like a "hde1234" or similar?
I don't know much about how or better where to define fir the IDE to ignore on exceptions🤔 but sibce we have those checkboxes in the screenshot I would guess, there are some settings that would be usable?
Would you know if we could somehow get this set in... directory.Build.props for example where we having the error code linting settings already in our solution? Or alternatively I did recognize lately on an aspire template, that it seems to be able to ignore error codes by defining the ignore codes on the PackageReference 💡
dr1rrb commentedon Aug 1, 2025
As far as I know, this is not something you can configure in the
Directory.Build.propsnor the.editoconfigfiles, it's really a Visual Studio specific configuration (and anyway on my side I'm toggling those on and off multiple times a day, would not want this to be stored in a file on the repo).You can see the full list of known exceptions in
Debug > Windows > Exception Settings(Ctrl + Alt + E) and then use checkboxes to enable / disable the "break on throw" of exceptions in the "Common Language Runtime Exceptions" section . You can also right-click and selectRestore Defaultsto select only "known to be meaning full" exceptions:jhanvi03 commentedon Aug 12, 2025
Marking as QA Review Done — the original issue has been addressed, and clicking 'Continue' allows changes to apply despite the HotReloadException behavior explained above.
Screen.Recording.2025-08-12.at.12.09.43.AM.mov