Open etvorun opened 2 years ago
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
I see that this still hasn't been added/documented anywhere in November of 2024, but I did figure out what is necessary to get Hot Reload working for configurations not named "Debug". Hopefully I can save someone else the hours of frustration I went through trying to figure out why it wasn't working.
I think these two properties are all that are needed:
<EnableHotReload>true</EnableHotReload>
<MauiXamlCValidateOnly>True</MauiXamlCValidateOnly>
However, it seems some stuff related to Hot Reload gets cached between deployments to the device, so I'm not 100% positive that only those two are required.
This is the exact solution I found that seems to be working in one of my apps that has multiple Debug configurations:
<PropertyGroup Condition=" '$(Configuration)' == 'DEV' ">
<DebugSymbols>true</DebugSymbols>
<Optimize>false</Optimize>
<EnableHotReload>true</EnableHotReload>
<UseInterpreter>true</UseInterpreter>
<MauiXamlCValidateOnly>True</MauiXamlCValidateOnly>
<MetadataUpdaterSupport>true</MetadataUpdaterSupport>
<AndroidLinkMode>None</AndroidLinkMode>
</PropertyGroup>
(that section immediately follows the main <PropertyGroup>
section at the start of the .csproj
file)
In the interest of improving the search engine discoverability of this issue for someone else running into the same problems I did, here are some error messages I encountered before finding the root cause of XAML Hot Reload not working:
"No code changes were found" "XAML Hot Reload is either disabled, not supported by the current application or the application execution is paused"
Description
Currently XAML Hot Reload is available in Debug config only. It appears to be controlled by _MauiXamlCValidateOnly. This needs to become public. So that customers can control hot reload experience in their custom configurations. Note that WPF, UWP and WinUI have such msbuild property and it is documented: _By default, source info is included in a Debug configuration. It is controlled by MSBuild properties in your project files (such as *.csproj). For WPF, the property is XamlDebuggingInformation, which must be set to True. For UWP, the property is DisableXbfLineInfo, which must be set to False. For example: WPF:
UWP: