2 minute read

Working on xamarin project and looking for hot reload ? Look at Xamarin Live reload. For using Xamarin Live Reload


simply go to Extension Manager search for live reload and install the xamarin live reload create a xamarin.forms project and switch to ui, you will see a yellow bar with connect option. If this doesn't show go to tools > options > live reload nad click on OK, it will appear.

after click on connect, give permission and go on, if you are using android project and already deployed app, you need to uninstall it.

You need to add these 3 magic lines in your xamarin app.xaml.cs

<span style="font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-size: 14px; white-space: pre; background-color: rgb(249, 249, 249);"> </span><span class="hljs-comment" style="box-sizing: inherit; color: green; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-size: 14px; white-space: pre;">// Initialize Live Reload.</span><span style="font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-size: 14px; white-space: pre; background-color: rgb(249, 249, 249);"> </span><span class="hljs-meta" style="box-sizing: inherit; color: rgb(0, 125, 154); font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-size: 14px; white-space: pre;">#if DEBUG</span><span style="font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-size: 14px; white-space: pre; background-color: rgb(249, 249, 249);"> LiveReload.Init(); </span><span class="hljs-meta" style="box-sizing: inherit; color: rgb(0, 125, 154); font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-size: 14px; white-space: pre;">#endif</span>

<span class="hljs-meta" style="box-sizing: inherit; color: rgb(0, 125, 154); font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-size: 14px; white-space: pre;"><span style="color: rgb(0, 0, 0); font-family: "Times New Roman"; font-size: medium; white-space: normal;">Now run the project and make changes you will see the ui changed in your android device, As per docs you need to stop project for modify the c# code. For detail look at this page</span></span>

<span class="hljs-meta" style="box-sizing: inherit; color: rgb(0, 125, 154); font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-size: 14px; white-space: pre;">
</span>
Thanks for reading my article 

Happy coding :)

Updated: