Xamarin Hot Reload does... Absolutely Nothing when Changes are Made

Viewed 3271

I'm creating a very UI centric application - in this application it is important (or event vital one can say) that I can actively preview my changes. Thankfully, Xamarin.Forms has Hot Reload - the perfect tool to get started to preview your changes!

I enabled hot reload in the 'Hot Reload' section in the options tab - I also enabled the 'Changes Made' (which is in preview) option to 'ON'.

I started my application - and I changed the text of a button... And...

Nothing.

I closed and reopened my app - and tried again... And... guess what?

Nothing.

Xamarin.Forms - come on!

This is a very annoying issue I've had on this specific application - it's taken away most of my day and I've just been fighting and fighting - and I have been unable to solve anything.

What I tried to do:

  1. I tried to upgrade my Xamarin.Forms version to the latest - and that still did not solve anything.
  2. I tried to enable and disable Hot Reload from the options menu - and that still did not solve anything.
  3. I tried to close and reopen the solution - clean - and build - and you guess it: still I could not preview my changes.
  4. I checked if I enabled it and it was enabled.
  5. I checked my linker settings and they were as expected.

Images:

enter image description here

XAML code:

I changed the background color to blue:

 <Grid HeightRequest="100"
                              Margin="5"
                              BackgroundColor="White"
                              RowSpacing="2">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="125" />
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="50" />
                            </Grid.ColumnDefinitions>



                            <Label Grid.Row="0"
                                   Grid.Column="1"
                                   TextColor="Blue"
                                   VerticalOptions="Center"
                                   Text="{Binding EventTitle}"
                                   Margin="7"
                                   Padding="10,0" />


                            <Image Grid.Row="0"
                                   HeightRequest="125"
                                   VerticalOptions="Start"
                                   Margin="2,2,1,2"
                                   Aspect="AspectFill"
                                   Source="{Binding Image}" />


                        </Grid>

My phone:

enter image description here

Even after saving - and waiting for at least half an hour - still the background is white.

I've tried everything possible to get it to work and I've been hitting the wall each time.

I am looking for help,

Thanks,

Tom

3 Answers

I've had all sorts of different issues with Hot Reload not working over the past few months.

I found the only consistent way that I could get it to work was by opening the project the long way around.

So:

  1. Open Visual Studio
  2. Choose Continue without code on the startup screen
  3. Go to File -> Open -> Project/Solution and choose the solution from there.

Whenever I load the project this way, Hot Reload will work. If I load it any other way, it seems to be really temperamental.

  1. Open project
  2. Go to Tools => Debugging => Hot Reload
  3. On "Common" section tick "Apply XAML hot reload on document save"
  4. on "Xamarin.Forms" section tick "Full Page"

as shown in the image (red circled below).Hot reload solution

On a project had the same issue , found out that i have to be in a XAML page and not a XAML.CS page

Then hit save and it starts again and oke.

Common options - only Enable Just My XAML in Live Visual Tree

And in Xamarin.Forms option -Full page

ps

On your example it is White

BackgroundColor="White"

Related