|
| 1 | +--- |
| 2 | +title: "Troubleshooting XAML Hot Reload" |
| 3 | +description: "Fix problems that you may encounter with XAML Hot Reload." |
| 4 | +ms.date: "09/04/2019" |
| 5 | +ms.topic: troubleshooting |
| 6 | +helpviewer_keywords: |
| 7 | + - "xaml edit and continue, troubleshooting" |
| 8 | + - "xaml hot reload, troubleshooting" |
| 9 | +author: "mikejo5000" |
| 10 | +ms.author: "mikejo" |
| 11 | +manager: jillfra |
| 12 | +ms.workload: |
| 13 | + - "multiple" |
| 14 | +--- |
| 15 | +# Troubleshooting XAML Hot Reload |
| 16 | + |
| 17 | +This troubleshooting guide includes detailed instructions that should resolve most issues that prevent XAML Hot Reload from working correctly. |
| 18 | + |
| 19 | +XAML Hot Reload is supported for WPF and UWP apps. For details on operating system and tooling requirements, see [Write and debug running XAML code with XAML Hot Reload](xaml-hot-reload.md). |
| 20 | + |
| 21 | +## Hot Reload is not available |
| 22 | + |
| 23 | +If you see the message "Hot Reload is not available" in the in-app toolbar while debugging your app, follow the instructions described in this article to resolve the issue. |
| 24 | + |
| 25 | +## Verify that XAML Hot Reload is enabled |
| 26 | + |
| 27 | +The feature is enabled by default. When you start debugging your app, make sure you see the in-app toolbar, which confirms that XAML Hot Reload is available: |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | +If you do not see the in-app toolbar, then open **Debug** > **Options** > **General**. Make sure that both options, **Enable UI Debugging Tools for XAML** and **Enable XAML Hot Reload** are selected. |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | +If these options are selected, then go to Live Visual Tree (**Debug** > **Windows** > **Live Visual Tree**) and make sure that **Show runtime tools in application** toolbar button (on the far left) is selected. |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | +## Verify that you use Start Debugging rather than Attach to Process |
| 40 | + |
| 41 | +XAML Hot Reload requires that the environment variable `ENABLE_XAML_DIAGNOSTICS_SOURCE_INFO` is set to 1 at the time application starts. Visual Studio sets this automatically as part of the **Debug** > **Start Debugging** (or **F5**) command. If you want to use XAML Hot Reload with the **Debug** > **Attach to Process** command instead, then set the environment variable yourself. |
| 42 | + |
| 43 | +## Verify that your MSBuild properties are correct |
| 44 | + |
| 45 | +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: |
| 46 | + |
| 47 | +WPF: |
| 48 | + |
| 49 | +`<XamlDebuggingInformation>True</XamlDebuggingInformation>` |
| 50 | + |
| 51 | +UWP: |
| 52 | + |
| 53 | +`<DisableXbfLineInfo>False</DisableXbfLineInfo>` |
| 54 | + |
| 55 | +## Verify that you are using the correct build configuration name |
| 56 | + |
| 57 | +You must either manually set the correct MSBuild property to support XAML Hot Reload (see previous section), or you must use the default build configuration name (Debug). If you don't set the MSBuild property correctly, a custom build configuration name won't work, nor will a Release build. |
| 58 | + |
| 59 | +## Verify that your XAML file has no errors |
| 60 | + |
| 61 | +If your XAML file shows errors in the **Error List**, then XAML Hot Reload may not work. |
| 62 | + |
| 63 | +## See also |
| 64 | + |
| 65 | +[Write and debug running XAML code with XAML Hot Reload](xaml-hot-reload.md) |
0 commit comments