Skip to content

Commit 284a46c

Browse files
dotnet-policy-service[bot]Copilotjfversluis
authored
Merge main into live (#3083)
* Add documentation for Windows ARM device limitations with Android emulators (#3038) * Initial plan * Add Windows ARM device limitations documentation for Android emulators Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com> Co-authored-by: Gerald Versluis <gerald.versluis@microsoft.com> * Document WebView2/BlazorWebView/HybridWebView issues with Program Files installation (#3035) * Initial plan * Add Windows Program Files warning for WebView2/BlazorWebView/HybridWebView Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com> * Extract WebView2 Program Files warning into reusable include snippet Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com> * Fix markdown linting errors in webview2-program-files-warning.md Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com> Co-authored-by: Gerald Versluis <gerald.versluis@microsoft.com> * Document device-independent units and their relationship to platform-specific units (#3036) * Initial plan * Add comprehensive device-independent units documentation Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com> * Update docs/user-interface/device-independent-units.md * Fix markdownlint errors: add blank lines before lists and trailing newline Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com> Co-authored-by: Gerald Versluis <gerald.versluis@microsoft.com> --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com> Co-authored-by: Gerald Versluis <gerald.versluis@microsoft.com>
1 parent d7767f5 commit 284a46c

File tree

14 files changed

+287
-8
lines changed

14 files changed

+287
-8
lines changed

docs/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,8 @@
277277
href: user-interface/controls/index.md
278278
- name: Align and position controls
279279
href: user-interface/align-position.md
280+
- name: Device-independent units
281+
href: user-interface/device-independent-units.md
280282
- name: Handlers
281283
items:
282284
- name: Overview

docs/android/emulator/hardware-acceleration.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,22 @@ For the best experience on Windows, it's recommended you use WHPX to accelerate
3131
> [!IMPORTANT]
3232
> A Virtual Machine (VM) accelerated emulator can run inside another VM, including Microsoft Dev Box, provided that nested virtualization is enabled in the VM.
3333
34+
### Windows ARM device limitations
35+
36+
The Android emulator currently requires x64 processor architecture and is **not supported on Windows ARM devices**. This limitation affects devices such as:
37+
38+
- Surface Pro X
39+
- Surface Pro 9 (5G/ARM variant)
40+
- Other Windows devices with ARM64 processors (Snapdragon, etc.)
41+
42+
If you're using a Windows ARM device, consider the following alternatives:
43+
44+
- Use a physical Android device for testing via USB debugging. For more information, see [Set up Android device for debugging](~/android/device/setup.md).
45+
- Use cloud-based testing services or remote development environments with x64 architecture.
46+
- Consider using Windows Subsystem for Android (WSA) if available, though this has different limitations and capabilities compared to the Android emulator.
47+
48+
For the latest information about Android emulator requirements, see [Android Emulator requirements](https://developer.android.com/studio/run/emulator#requirements) on developer.android.com.
49+
3450
For information about launching and debugging with the Android emulator, see [Debugging on the Android Emulator](debug-on-emulator.md).
3551

3652
## Accelerate with Hyper-V

docs/android/emulator/troubleshooting.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ Performance issues are typically caused by one of the following problems:
6060

6161
- The emulator is running without hardware acceleration.
6262
- The virtual device running in the emulator using an Arm-based image.
63+
- You're trying to run the emulator on a Windows ARM device (not supported).
6364

6465
The following sections cover these scenarios in more detail.
6566

@@ -71,6 +72,22 @@ When you start a virtual device, and you don't have hardware acceleration enable
7172

7273
To fix this error, follow the troubleshooting steps in the [Hardware acceleration issues](#hardware-acceleration-issues) section.
7374

75+
### Windows ARM device compatibility
76+
77+
The Android emulator is **not supported on Windows ARM devices** and will not run on devices with ARM64 processors such as:
78+
79+
- Surface Pro X
80+
- Surface Pro 9 (5G/ARM variant)
81+
- Other Windows devices with Snapdragon or ARM-based processors
82+
83+
If you're using a Windows ARM device and encounter emulator startup issues or performance problems, this is likely due to the architecture incompatibility. The Android emulator requires x64 processor architecture.
84+
85+
**Alternatives for Windows ARM devices:**
86+
87+
- Use a physical Android device connected via USB for debugging. For setup instructions, see [Set up Android device for debugging](~/android/device/setup.md).
88+
- Use cloud-based development environments or remote machines with x64 architecture.
89+
- Consider Windows Subsystem for Android (WSA) if available in your region, though it has different capabilities and limitations.
90+
7491
## Hardware acceleration issues
7592

7693
When using hardware acceleration, you may run into configuration problems or conflicts with other software on your computer. The first step in troubleshooting is verifying that hardware acceleration is enabled. You can use the Android's SDK to check this setting. Open a command prompt and entering the following command:

docs/fundamentals/gestures/swipe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ In .NET MAUI, drag gesture recognition is provided by the <xref:Microsoft.Maui.C
1313
- <xref:Microsoft.Maui.Controls.SwipeGestureRecognizer.Command>, of type <xref:System.Windows.Input.ICommand>, which is executed when a swipe gesture is recognized.
1414
- <xref:Microsoft.Maui.Controls.SwipeGestureRecognizer.CommandParameter>, of type `object`, which is the parameter that's passed to the `Command`.
1515
- <xref:Microsoft.Maui.Controls.SwipeGestureRecognizer.Direction>, of type <xref:Microsoft.Maui.SwipeDirection>, which defines the direction
16-
- <xref:Microsoft.Maui.Controls.SwipeGestureRecognizer.Threshold>, of type `uint`, which represents the minimum swipe distance that must be achieved for a swipe to be recognized, in device-independent units. The default value of this property is 100, which means that any swipes that are less than 100 device-independent units will be ignored.
16+
- <xref:Microsoft.Maui.Controls.SwipeGestureRecognizer.Threshold>, of type `uint`, which represents the minimum swipe distance that must be achieved for a swipe to be recognized, in device-independent units. The default value of this property is 100, which means that any swipes that are less than 100 device-independent units will be ignored. For more information about device-independent units, see [Device-independent units](../../user-interface/device-independent-units.md).
1717

1818
These properties are backed by <xref:Microsoft.Maui.Controls.BindableProperty> objects, which means that they can be targets of data bindings, and styled.
1919

docs/fundamentals/triggers.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,9 @@ The <xref:Microsoft.Maui.Controls.AdaptiveTrigger.MinWindowHeight> and <xref:Mic
370370

371371
In this example, the <xref:Microsoft.Maui.Controls.AdaptiveTrigger> indicates that the corresponding <xref:Microsoft.Maui.Controls.VisualState> will be applied when the current window width is >= 800 device-independent units and the current window height is >= 1200 device-independent units.
372372

373+
> [!NOTE]
374+
> For more information about device-independent units, see [Device-independent units](../user-interface/device-independent-units.md).
375+
373376
### Compare state trigger
374377

375378
The <xref:Microsoft.Maui.Controls.CompareStateTrigger> triggers a <xref:Microsoft.Maui.Controls.VisualState> change when a property is equal to a specific value. This trigger has two bindable properties:

docs/get-started/installation.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,9 @@ To download and install an Android emulator on which to run your apps:
295295

296296
For more information about the `avdmanager` command, see [avdmanager](https://developer.android.com/tools/avdmanager) on developer.android.com.
297297

298+
> [!IMPORTANT]
299+
> **Windows ARM devices**: The Android emulator requires x64 architecture and is not supported on Windows ARM devices (such as Surface Pro X). If you're using a Windows ARM device, consider using a physical Android device for testing instead. For more information, see [Set up Android device for debugging](~/android/device/setup.md).
300+
298301
### iOS and macOS
299302

300303
To set up your Mac for .NET MAUI development on iOS and Mac Catalyst with Visual Studio Code:

docs/user-interface/align-position.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ The following diagram illustrates the two concepts:
5959
:::image type="content" source="media/align-position/margin-padding.png" alt-text="Margin and padding concepts." border="false":::
6060

6161
> [!NOTE]
62-
> `Margin` values are additive. Therefore, if two adjacent elements specify a margin of 20 device-independent units, the distance between the elements will be 40 device-independent units. In addition, margin and padding values are additive when both are applied, in that the distance between an element and any content will be the margin plus padding.
62+
> `Margin` values are additive. Therefore, if two adjacent elements specify a margin of 20 device-independent units, the distance between the elements will be 40 device-independent units. In addition, margin and padding values are additive when both are applied, in that the distance between an element and any content will be the margin plus padding. For more information about device-independent units, see [Device-independent units](device-independent-units.md).
6363
6464
The `Margin` and `Padding` properties are both of type `Thickness`. There are three possibilities when creating a `Thickness` structure:
6565

docs/user-interface/controls/blazorwebview.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Host a Blazor web app in a .NET MAUI app using BlazorWebView"
33
description: "The .NET MAUI BlazorWebView control enables you to host a Blazor web app in your .NET MAUI app, and integrate the app with device features."
4-
ms.date: 05/13/2025
4+
ms.date: 09/19/2025
55
---
66

77
# Host a Blazor web app in a .NET MAUI app using BlazorWebView
@@ -33,6 +33,8 @@ Browser developer tools can be used to inspect .NET MAUI Blazor apps. For more i
3333
> [!NOTE]
3434
> While Visual Studio installs all the required tooling to develop .NET MAUI Blazor apps, end users of .NET MAUI Blazor apps on Windows must install the [WebView2](https://developer.microsoft.com/microsoft-edge/webview2/) runtime.
3535
36+
[!INCLUDE [WebView2 Program Files warning](includes/webview2-program-files-warning.md)]
37+
3638
For more information about Blazor Hybrid apps, see [ASP.NET Core Blazor Hybrid](/aspnet/core/blazor/hybrid).
3739

3840
[!INCLUDE [browser-engines](includes/browser-engines.md)]

docs/user-interface/controls/hybridwebview.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: HybridWebView
33
description: Learn how to use a HybridWebView to host HTML/JS/CSS content in a WebView, and communicate between that content and .NET.
44
ms.topic: concept-article
5-
ms.date: 08/20/2025
5+
ms.date: 09/19/2025
66
monikerRange: ">=net-maui-9.0"
77

88
#customer intent: As a developer, I want to host HTML/JS/CSS content in a web view so that I can publish the web app as a mobile app.
@@ -34,6 +34,8 @@ The entire app, including the web content, is packaged and runs locally on a dev
3434
> [!IMPORTANT]
3535
> By default, the <xref:Microsoft.Maui.Controls.HybridWebView> control won't be available when full trimming or Native AOT is enabled. To change this behavior, see [Trimming feature switches](~/deployment/trimming.md#trimming-feature-switches).
3636
37+
[!INCLUDE [WebView2 Program Files warning](includes/webview2-program-files-warning.md)]
38+
3739
[!INCLUDE [browser-engines](includes/browser-engines.md)]
3840

3941
## Create a .NET MAUI HybridWebView app
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
ms.topic: include
3+
ms.date: 09/19/2025
4+
---
5+
6+
> [!WARNING]
7+
> On Windows, apps using WebView2-based controls that are installed to the `Program Files` directory may fail to render content properly. This occurs because WebView2 attempts to write its cache and user data files to the app's installation directory, which has restricted write permissions in `Program Files`. To resolve this issue, set the `WEBVIEW2_USER_DATA_FOLDER` environment variable before any WebView control is initialized:
8+
>
9+
> ```csharp
10+
> #if WINDOWS
11+
> var userDataFolder = Path.Combine(FileSystem.AppDataDirectory, "WebView2");
12+
> Environment.SetEnvironmentVariable("WEBVIEW2_USER_DATA_FOLDER", userDataFolder);
13+
> #endif
14+
> ```
15+
>
16+
> Place this code in your `App.xaml.cs` constructor or in `Platforms\Windows\App.xaml.cs` before any WebView control is created. This directs WebView2 to use a writable location in the user's AppData directory instead of the restricted Program Files location.

0 commit comments

Comments
 (0)