Skip to content

Commit d92eb5f

Browse files
committed
fix: Ensure proper error reporting when a WinAppSDK project references Uno
1 parent 46c1796 commit d92eb5f

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

build/uno.winui.targets

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,10 @@
1010
<Import Project="uno.winui.single-project.targets" />
1111
<Import Project="uno.winui.runtime-replace.targets" Condition="'$(WindowsAppSDKWinUI)'!='true'" />
1212

13+
<Target Name="_WinAppSDKNotSupported"
14+
BeforeTargets="BeforeBuild"
15+
Condition="'$(WindowsAppSDKWinUI)'=='True'">
16+
<Error Code="UNOB0002"
17+
Text="Using Uno.WinUI in a WinAppSDK head project is not supported. You may be including a package that references Uno.WinUI indirectly and it must be removed. See https://aka.platform.uno/UNOB0002 for more details." />
18+
</Target>
1319
</Project>

doc/articles/features/VisibleBoundsPadding.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ The `ApplicationView.VisibleBounds` is the rectangular area of the screen which
55

66
In some cases it's acceptable for visible content to be partially obscured (a page background for example) and it should extend to fill the entire window. Other types of content should be restricted to the visible bounds (for instance readable text, or interactive controls). VisibleBoundsPadding enables this kind of fine-grained control over responsiveness to the visible bounds.
77

8+
> [!IMPORTANT]
9+
> The [`SafeArea`](../external/uno.toolkit.ui/doc/controls/SafeArea.md) control is now preferred to `VisibleBoundsPadding`.
10+
811
## Using the behavior
912
The behavior can be placed on any control that provides a Padding property (e.g. Grid, StackPanel, ListView, ScrollViewer, Control, ContentPresenter or Border), and will be automatically adjusted based on the control's absolute position inside the `ApplicationView.VisibleBounds` rectangle.
1013

doc/articles/get-started-wizard.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,6 @@ This issue is caused by visual studio enforcing https connections for local cont
126126
In general, this error happens when the XAML parser detects a syntax error. Fixing the error generally fixes the build.
127127

128128
This error may happen occasionally without any explicit error message, rebuilding the project may fix the issue.
129+
130+
#### Error UNOB0002: Using Uno.WinUI in a WinAppSDK head project is not supported
131+
This This issue can arise when Uno.WinUI packages are included in a `.Windows` head project, which is not supported. You can fix this by removing the Uno.WinUI or the packages that transitively reference it. For example, including a reference to `Uno.CommunityToolkit.WinUI.*` will transitively include a reference to `Uno.WinUI`, and [the official community toolkit packages](uno-community-toolkit.md) must be used instead.

0 commit comments

Comments
 (0)